revert group clear

This commit is contained in:
huangtong.ht 2018-08-10 17:22:34 +08:00
parent 1295bff9e4
commit 96889ce205
2 changed files with 14 additions and 1 deletions

View File

@ -99,7 +99,7 @@
"screenshot": "node ./bin/screenshot.js",
"start": "npm run dev",
"test": "torch --compile --renderer --recursive ./test/unit",
"test-live": "torch --compile --interactive --watch --recursive ./test/unit/plugins/tool.textDisplay-spec.js",
"test-live": "torch --compile --interactive --watch --recursive ./test/unit/",
"watch": "webpack --config webpack-dev.config.js",
"win-dev": "node ./bin/win-dev.js"
},

View File

@ -61,6 +61,19 @@ Util.augment(Mixin, {
sortBy(callback) {
const children = this.get('children');
this.set('children', Util.radixSort(children, callback));
},
/**
* clear inner elements
* @param {boolean} bool if destroy child
* @return {object} this
*/
clear(bool) {
const children = this._cfg.children;
for (let i = children.length - 1; i >= 0; i--) {
children[i].remove(bool);
}
this._cfg.children = [];
return this;
}
});