mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Add Document#remove().
This commit is contained in:
parent
5593eb94d0
commit
df1c5cdcbb
1 changed files with 11 additions and 5 deletions
|
@ -108,10 +108,6 @@ var Document = this.Document = Base.extend({
|
||||||
this._currentStyle = PathStyle.create(null, style);
|
this._currentStyle = PathStyle.create(null, style);
|
||||||
},
|
},
|
||||||
|
|
||||||
getIndex: function() {
|
|
||||||
return this._index;
|
|
||||||
},
|
|
||||||
|
|
||||||
activate: function() {
|
activate: function() {
|
||||||
if (this._index != null) {
|
if (this._index != null) {
|
||||||
this._scope.document = this;
|
this._scope.document = this;
|
||||||
|
@ -119,7 +115,17 @@ var Document = this.Document = Base.extend({
|
||||||
}
|
}
|
||||||
return false;
|
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() {
|
getSelectedItems: function() {
|
||||||
// TODO: return groups if their children are all selected,
|
// TODO: return groups if their children are all selected,
|
||||||
// and filter out their children from the list.
|
// and filter out their children from the list.
|
||||||
|
|
Loading…
Reference in a new issue