summaryrefslogtreecommitdiff
path: root/overrides/Endless.js
diff options
context:
space:
mode:
authormatt <mattdangerw@gmail.com>2013-05-09 19:58:27 -0700
committerP. F. Chimento <philip.chimento@gmail.com>2013-05-16 11:08:14 +0200
commitdd110019a1c00fcfbb532f50d9978761a04272d9 (patch)
tree818efebea610abb684352958ea247156a4a771cc /overrides/Endless.js
parent3d90c34af665131f15b5e37763521da5d8d220f2 (diff)
Added javascript override to the page manager add function
Added the autotooling to get our overrides installing as well. [endlessm/eos-sdk#70]
Diffstat (limited to 'overrides/Endless.js')
-rw-r--r--overrides/Endless.js18
1 files changed, 18 insertions, 0 deletions
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]);
+ }
+ }
+ }
+}