mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Remove all views in Document#remove().
This commit is contained in:
parent
3a15360efc
commit
abcba7deb4
1 changed files with 4 additions and 0 deletions
|
@ -78,6 +78,10 @@ var Document = this.Document = Base.extend({
|
|||
remove: function() {
|
||||
var res = Base.splice(this._scope.documents, null, this._index, 1);
|
||||
this._scope = null;
|
||||
// Remove all views. This also removes the event handlers installed for
|
||||
// then.
|
||||
for (var i = this.views.length - 1; i >= 0; i--)
|
||||
this.views[i].remove();
|
||||
return !!res.length;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue