summaryrefslogtreecommitdiff
path: root/overrides
diff options
context:
space:
mode:
Diffstat (limited to 'overrides')
-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]);
+ }
+ }
+ }
+}