mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-02 22:33:33 +02:00
Move Tab* event handlers to the tabs module.
This commit is contained in:
@@ -1326,28 +1326,6 @@ const Events = Module("events", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tabContainer = tabs.getBrowser().mTabContainer;
|
|
||||||
|
|
||||||
tabContainer.addEventListener("TabMove", function (event) {
|
|
||||||
statusline.updateTabCount(true);
|
|
||||||
}, false);
|
|
||||||
tabContainer.addEventListener("TabOpen", function (event) {
|
|
||||||
statusline.updateTabCount(true);
|
|
||||||
}, false);
|
|
||||||
tabContainer.addEventListener("TabClose", function (event) {
|
|
||||||
statusline.updateTabCount(true);
|
|
||||||
}, false);
|
|
||||||
tabContainer.addEventListener("TabSelect", function (event) {
|
|
||||||
// TODO: is all of that necessary?
|
|
||||||
// I vote no. --Kris
|
|
||||||
modes.reset();
|
|
||||||
statusline.updateTabCount(true);
|
|
||||||
tabs.updateSelectionHistory();
|
|
||||||
|
|
||||||
if (options["focuscontent"])
|
|
||||||
setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
tabs.getBrowser().addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
|
tabs.getBrowser().addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
|
||||||
|
|
||||||
// this adds an event which is is called on each page load, even if the
|
// this adds an event which is is called on each page load, even if the
|
||||||
|
|||||||
@@ -24,12 +24,36 @@ const Tabs = Module("tabs", {
|
|||||||
this._lastBufferSwitchArgs = "";
|
this._lastBufferSwitchArgs = "";
|
||||||
this._lastBufferSwitchSpecial = true;
|
this._lastBufferSwitchSpecial = true;
|
||||||
|
|
||||||
|
let tabContainer = this.getBrowser().mTabContainer;
|
||||||
|
this._updateTabCount = function () { statusline.updateTabCount(true); };
|
||||||
|
["TabMove", "TabOpen", "TabClose"].forEach(function (event) {
|
||||||
|
tabContainer.addEventListener(event, this._updateTabCount, false);
|
||||||
|
}, this);
|
||||||
|
this._onTabSelect = function () {
|
||||||
|
// TODO: is all of that necessary?
|
||||||
|
// I vote no. --Kris
|
||||||
|
modes.reset();
|
||||||
|
statusline.updateTabCount(true);
|
||||||
|
this.updateSelectionHistory();
|
||||||
|
if (options["focuscontent"])
|
||||||
|
setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
|
||||||
|
};
|
||||||
|
tabContainer.addEventListener("TabSelect", this.closure._onTabSelect, false);
|
||||||
|
|
||||||
// hide tabs initially to prevent flickering when 'stal' would hide them
|
// hide tabs initially to prevent flickering when 'stal' would hide them
|
||||||
// on startup
|
// on startup
|
||||||
if (config.hasTabbrowser)
|
if (config.hasTabbrowser)
|
||||||
this.getBrowser().mTabContainer.collapsed = true; // FIXME: see 'stal' comment
|
this.getBrowser().mTabContainer.collapsed = true; // FIXME: see 'stal' comment
|
||||||
},
|
},
|
||||||
|
|
||||||
|
destroy: function () {
|
||||||
|
let tabContainer = this.getBrowser().mTabContainer;
|
||||||
|
["TabMove", "TabOpen", "TabClose"].forEach(function (event) {
|
||||||
|
tabContainer.removeEventListener(event, this._updateTabCount, false);
|
||||||
|
}, this);
|
||||||
|
tabContainer.removeEventListener("TabSelect", this.closure._onTabSelect, false);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {Object} The previously accessed tab or null if no tab
|
* @property {Object} The previously accessed tab or null if no tab
|
||||||
* other than the current one has been accessed.
|
* other than the current one has been accessed.
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ ARCHITECTURE:
|
|||||||
hell, and/or lack support for JS 1.8. --Kris
|
hell, and/or lack support for JS 1.8. --Kris
|
||||||
|
|
||||||
BUGS:
|
BUGS:
|
||||||
|
- Class#closure seems to be throwing [Exception... "Could not convert
|
||||||
|
JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"]
|
||||||
|
in as yet underdetermined circumstances.
|
||||||
- add window resize support to hints
|
- add window resize support to hints
|
||||||
- searching backwards incrementally does not work i.e. with 'incsearch' set
|
- searching backwards incrementally does not work i.e. with 'incsearch' set
|
||||||
- insert abbreviations broken on <space>
|
- insert abbreviations broken on <space>
|
||||||
|
|||||||
Reference in New Issue
Block a user