mirror of
https://github.com/atom/atom.git
synced 2026-02-10 06:35:00 -05:00
Add $.fn.view method, which links any jquery element to its parent view.
When generating a jQuery fragment with the templating framework, I store the fragment in the 'view' data property on all the fragments elements. This allows us to query an element from the DOM and determine what view object it belongs to.
This commit is contained in:
@@ -27,6 +27,7 @@ class Builder
|
||||
toFragment: ->
|
||||
fragment = $(@toHtml())
|
||||
@wireOutlets fragment
|
||||
fragment.find('*').andSelf().data('view', fragment)
|
||||
fn(fragment) for fn in @postProcessingFns
|
||||
fragment
|
||||
|
||||
|
||||
Reference in New Issue
Block a user