Skip to content

Commit

Permalink
only allow force inside _removeView if the view contains a parent
Browse files Browse the repository at this point in the history
  • Loading branch information
tbranyen committed Sep 2, 2012
1 parent df8d0a5 commit e90f86f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backbone.layoutmanager.js
Expand Up @@ -696,6 +696,8 @@ var LayoutManager = Backbone.View.extend({
var manager = view.__manager__;
// Test for keep.
var keep = _.isBoolean(view.keep) ? view.keep : view.options.keep;
// Only allow force if View contains a parent.
force = force && manager.parent;

// Only remove views that do not have `keep` attribute set, unless the
// force flag is set.
Expand Down
2 changes: 1 addition & 1 deletion dist/backbone.layoutmanager.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e90f86f

Please sign in to comment.