Skip to content

Commit df1c5cd

Browse files
committed
Add Document#remove().
1 parent 5593eb9 commit df1c5cd

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/document/Document.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,24 @@ var Document = this.Document = Base.extend({
108108
this._currentStyle = PathStyle.create(null, style);
109109
},
110110

111-
getIndex: function() {
112-
return this._index;
113-
},
114-
115111
activate: function() {
116112
if (this._index != null) {
117113
this._scope.document = this;
118114
return true;
119115
}
120116
return false;
121117
},
122-
118+
119+
remove: function() {
120+
var res = Base.splice(this._scope.documents, null, this._index, 1);
121+
this._scope = this._index = null;
122+
return !!res.length;
123+
},
124+
125+
getIndex: function() {
126+
return this._index;
127+
},
128+
123129
getSelectedItems: function() {
124130
// TODO: return groups if their children are all selected,
125131
// and filter out their children from the list.

0 commit comments

Comments
 (0)