This commit is contained in:
2021-11-01 21:52:13 +03:00
parent 353e0715ca
commit 82452a959e
12 changed files with 798 additions and 844 deletions
+12 -8
View File
@@ -2,26 +2,30 @@
kit.PluginManager.register('ActionCollection', function(module, exports, require, global) {
var Collection = require('Collection');
var support = require('support');
/**
* @class ActionCollection
* @extends {kit.Collection}
* @memberOf kit
*/
var ActionCollection = function (list = []) {
this.collection = new Collection(list);
Collection.prototype.constructor.apply(this, arguments);
};
ActionCollection.prototype.push = function (action) {
this.collection.push(action);
};
ActionCollection.prototype.run = function (count = -1) {
this.collection.map(function (action) {
var proto = ActionCollection.prototype;
proto.run = function (count = -1) {
this.map(function (action) {
action.run(count);
})
};
ActionCollection.prototype.stop = function () {
this.collection.map(function (action) {
proto.stop = function () {
this.map(function (action) {
action.stop();
})
};
support.extend(ActionCollection.prototype, Collection.prototype);
return module.exports = ActionCollection;
});