Skip to content

Commit

Permalink
Allowing to consider isElContained(findEl) will return true when find…
Browse files Browse the repository at this point in the history
…El is the same node than this._el in collection binder managers
  • Loading branch information
fcamblor committed Oct 24, 2018
1 parent e2f406c commit aee8ae7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Backbone.CollectionBinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,12 @@
},

isElContained: function(findEl){
return this._el === findEl || $(this._el).has(findEl).length > 0;
if(this._el === findEl){
return true;
}

var $el = $(this._el);
return $el.has(findEl).length > 0 || $el.is(findEl);
},

getModel: function(){
Expand Down Expand Up @@ -295,7 +300,7 @@
},

isElContained: function(findEl){
return this._view.el === findEl || this._view.$el.has(findEl).length > 0;
return this._view.el === findEl || this._view.$el.has(findEl).length > 0 || this._view.$el.is(findEl);
},

getModel: function(){
Expand Down

0 comments on commit aee8ae7

Please sign in to comment.