From dd110019a1c00fcfbb532f50d9978761a04272d9 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 9 May 2013 19:58:27 -0700 Subject: Added javascript override to the page manager add function Added the autotooling to get our overrides installing as well. [endlessm/eos-sdk#70] --- overrides/Endless.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 overrides/Endless.js (limited to 'overrides') diff --git a/overrides/Endless.js b/overrides/Endless.js new file mode 100644 index 0000000..00315a3 --- /dev/null +++ b/overrides/Endless.js @@ -0,0 +1,18 @@ +let Endless; + +function _init() { + // this is imports.gi.Endless + Endless = this; + + // Override Endless.PageManager.add() so that you can set child properties + // at the same time + Endless.PageManager.prototype._add_real = Endless.PageManager.prototype.add; + Endless.PageManager.prototype.add = function(child, props) { + this._add_real(child); + if(typeof(props) !== 'undefined') { + for(let prop_id in props) { + this.child_set_property(child, prop_id, props[prop_id]); + } + } + } +} -- cgit v1.2.3