Skip to content

Commit

Permalink
optimized removing views from layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Heymann committed Apr 24, 2014
1 parent 026229b commit ba24a81
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
removeView: function(destination, index) {
var viewToRemove = (typeof destination === 'string') ? this.getView(destination, index) : destination;
if (viewToRemove) {
var done;
var keepIterating;
_.each(this._byDestination, function(byMethod, selector) {
_.each(byMethod, function(views, method) {
_.each(views, function(view, index) {
Expand All @@ -277,10 +277,13 @@

this._byDestination[selector][method].splice(index, 1);
this.views = _.without(this.views, viewToRemove);
return false;

return keepIterating = false;
}
}, this);
return keepIterating;
}, this);
return keepIterating;
}, this);
}
},
Expand Down

0 comments on commit ba24a81

Please sign in to comment.