diff --git a/common/content/events.js b/common/content/events.js index bf9774db..bc04e386 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -72,7 +72,9 @@ var EventHive = Class("EventHive", Contexts.Hive, { } return !args[0].get(); }); - } + }, + + get wrapListener() events.closure.wrapListener }); /** @@ -84,14 +86,6 @@ var Events = Module("events", { init: function () { this.keyEvents = []; - update(this, { - hives: contexts.Hives("events", EventHive), - user: contexts.hives.events.user, - builtin: contexts.hives.events.builtin - }); - - EventHive.prototype.wrapListener = this.closure.wrapListener; - XML.ignoreWhitespace = true; overlay.overlayWindow(window, { append: @@ -951,6 +945,14 @@ var Events = Module("events", { event.preventDefault(); } }, { + contexts: function initContexts(dactyl, modules, window) { + update(Events.prototype, { + hives: contexts.Hives("events", EventHive), + user: contexts.hives.events.user, + builtin: contexts.hives.events.builtin + }); + }, + commands: function () { commands.add(["delmac[ros]"], "Delete macros", diff --git a/common/modules/main.jsm b/common/modules/main.jsm index cbb2d30a..f61557c2 100644 --- a/common/modules/main.jsm +++ b/common/modules/main.jsm @@ -70,7 +70,12 @@ var Modules = function Modules(window) { var base = ModuleBase; if (callable(args[1])) base = args.splice(1, 1)[0]; + let [, prototype, classProperties, moduleInit] = args; + prototype._metaInit_ = function () { + delete module.prototype._metaInit_; + Class.replaceProperty(modules, module.className, this); + }; const module = Class(name, base, prototype, classProperties); module.INIT = moduleInit || {};