Add Document#remove().

This commit is contained in:
Jürg Lehni 2011-05-14 18:58:41 +01:00
parent 5593eb94d0
commit df1c5cdcbb

View file

@ -108,10 +108,6 @@ var Document = this.Document = Base.extend({
this._currentStyle = PathStyle.create(null, style);
},
getIndex: function() {
return this._index;
},
activate: function() {
if (this._index != null) {
this._scope.document = this;
@ -119,7 +115,17 @@ var Document = this.Document = Base.extend({
}
return false;
},
remove: function() {
var res = Base.splice(this._scope.documents, null, this._index, 1);
this._scope = this._index = null;
return !!res.length;
},
getIndex: function() {
return this._index;
},
getSelectedItems: function() {
// TODO: return groups if their children are all selected,
// and filter out their children from the list.