UNPKG

susi-forge

Version:
30 lines (25 loc) 596 B
ControllerFactory.create('cards', { init: function () { this.__cards = []; this._init(); }, update: function () { console.info('updating cardsController'); var i = 0, l = this.__cards.length; for (; i < l; ++i) { this.__cards[i].update(); } this._update(); }, addCard: function () {}, moveCard: function () {}, removeCard: function () {}, _createCard: function (impl) { var id = 'card_'+(new Date().getTime() * Math.random(100)); impl = impl || {}; this.__cards.push( ControllerFactory.create(id), impl ); } });