Split PaperScope#remove() into #clear() and #remove(), so scopes can be reused.

This commit is contained in:
Jürg Lehni 2011-05-16 00:56:47 +01:00
parent 593813660a
commit 30e3359d1d

View file

@ -42,7 +42,7 @@ var PaperScope = this.PaperScope = Base.extend({
}, scope);
},
remove: function() {
clear: function() {
// Remove all documents and tools.
for (var i = this.documents.length - 1; i >= 0; i--)
this.documents[i].remove();
@ -50,6 +50,11 @@ var PaperScope = this.PaperScope = Base.extend({
this.tools[i].remove();
},
remove: function() {
this.clear();
delete PaperScope.scopes[this.id];
},
statics: {
scopes: {},