diff options
author | Felipe Erias Morandeira <femorandeira@igalia.com> | 2013-06-07 16:16:47 +0200 |
---|---|---|
committer | Felipe Erias Morandeira <femorandeira@igalia.com> | 2013-06-21 14:14:14 +0100 |
commit | 45ee1b7fe40c97a539def40c92fd3f6b47279cc6 (patch) | |
tree | cdcae76c325e335316163ebee345af43eab2338e /overrides | |
parent | a590e08267771472dd5c89ce01c1ffcbb21cb978 (diff) |
Override Endless.ActionMenu.add_action() to hide GtkAction from the developer, as that will be deprecated in the future.
[endlessm/eos-sdk#79]
Diffstat (limited to 'overrides')
-rw-r--r-- | overrides/Endless.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/overrides/Endless.js b/overrides/Endless.js index 00315a3..8fadd94 100644 --- a/overrides/Endless.js +++ b/overrides/Endless.js @@ -15,4 +15,16 @@ function _init() { } } } + + // Override Endless.ActionMenu.add_action() so that we hide the use of + // GtkAction from the developer, as that will be deprecated in the future. + Endless.ActionMenu.prototype._add_action_real = Endless.ActionMenu.prototype.add_action; + Endless.ActionMenu.prototype.add_action = function(dict, callback) { + let action = new Gtk.Action(dict); + this._add_action_real(action); + + if (typeof callback === "function") { + action.connect('activate', callback); + } + } } |