1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 17:47:59 +01:00

[bootstrap] Changes toward proper reinitialization after disabling.

--HG--
branch : bootstrapped
This commit is contained in:
Kris Maglione
2010-12-24 15:51:02 -05:00
parent 0d8f23fea5
commit 2f081bd805
7 changed files with 269 additions and 238 deletions

View File

@@ -136,7 +136,7 @@ const CommandWidgets = Class("CommandWidgets", {
if (this.command && !options.get("guioptions").has("M"))
return this.statusbar;
let statusElem = this.statusbar.message;
if (value && statusElem.editor.rootElement.scrollWidth > statusElem.scrollWidth)
if (value && statusElem.inputField.editor.rootElement.scrollWidth > statusElem.scrollWidth)
return this.commandbar;
return this.activeGroup.mode;
}
@@ -164,9 +164,12 @@ const CommandWidgets = Class("CommandWidgets", {
addElement: function (obj) {
const self = this;
this.elements[obj.name] = obj;
function get(id) obj.getElement ? obj.getElement(id) : document.getElementById(id);
this.active.__defineGetter__(obj.name, function () self.activeGroup[obj.name][obj.name]);
this.activeGroup.__defineGetter__(obj.name, function () self.getGroup(obj.name));
memoize(this.statusbar, obj.name, function () get("dactyl-statusline-field-" + (obj.id || obj.name)));
memoize(this.commandbar, obj.name, function () get("dactyl-" + (obj.id || obj.name)));