Fixing getManagerForEl when root element is provided#232
Open
fcamblor wants to merge 3 commits intotheironcook:masterfrom
Open
Fixing getManagerForEl when root element is provided#232fcamblor wants to merge 3 commits intotheironcook:masterfrom
fcamblor wants to merge 3 commits intotheironcook:masterfrom
Conversation
…ined when root element is provided
…El is the same node than this._el in collection binder managers
40270bd to
22bd129
Compare
theironcook
reviewed
Oct 26, 2018
| } | ||
|
|
||
| var $el = $(this._el); | ||
| return $el.has(findEl).length > 0 || $el.is(findEl); |
Owner
There was a problem hiding this comment.
Sorry but aren't these 2 statements the same thing?
this._el === findEl
$el.is(findEl)
Contributor
Author
There was a problem hiding this comment.
Nope, that's my concern on root node : they "represent" the same DOM node, but are different instances
Contributor
Author
There was a problem hiding this comment.
I guess we could make a single $(this._el)[0] === $(findEl)[0] but this sound a bit hacky
However, I agree we could imagine making a single $el.is(findEl) test (removing this._el === findEl test)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When root collection item element is provided to getManagerForEl(), manager is not resolved because of a missing self-check.
Provided a unit test demonstrating the issue.
Note that I re-generated minified version of
Backbone.CollectionBinder.jsusing https://jscompress.com which makes some variable naming changing in the resulting code.Tell me if :