X-Git-Url: https://git.donarmstrong.com/?p=dactyl.git;a=blobdiff_plain;f=pentadactyl%2Fcontent%2Fconfig.js;h=8c10f837e3f352f252d88136b3bf5c2d7648700d;hp=c9ae10b3823e1d16d5f0f60657b148d3593fa893;hb=8b6fcae7eaa413bc62d645d2d0c99835c47265e6;hpb=5ebd29f56d17f62011cdd596b1d351947ee534ff diff --git a/pentadactyl/content/config.js b/pentadactyl/content/config.js index c9ae10b..8c10f83 100644 --- a/pentadactyl/content/config.js +++ b/pentadactyl/content/config.js @@ -67,7 +67,9 @@ var Config = Module("config", ConfigBase, { }, removeTab: function removeTab(tab) { - if (this.tabbrowser.mTabs.length > 1) + if (window.gInPrintPreviewMode) + window.PrintUtils.exitPrintPreview(); + else if (this.tabbrowser.mTabs.length > 1) this.tabbrowser.removeTab(tab); else { if (modules.buffer.uri.spec !== "about:blank" || window.getWebNavigation().sessionHistory.count > 0) { @@ -92,7 +94,7 @@ var Config = Module("config", ConfigBase, { }, { }, { - commands: function (dactyl, modules, window) { + commands: function initCommands(dactyl, modules, window) { const { commands, completion, config } = modules; const { document } = window; @@ -203,7 +205,7 @@ var Config = Module("config", ConfigBase, { privateData: true }); }, - completion: function (dactyl, modules, window) { + completion: function initCompletion(dactyl, modules, window) { const { CompletionContext, bookmarkcache, completion } = modules; const { document } = window; @@ -222,7 +224,7 @@ var Config = Module("config", ConfigBase, { context.completions = Array.map(menu.childNodes, function (n) [n.getAttribute("label"), ""]); }; }, - events: function (dactyl, modules, window) { + events: function initEvents(dactyl, modules, window) { modules.events.listen(window, "SidebarFocused", function (event) { modules.config.lastSidebar = window.document.getElementById("sidebar-box") .getAttribute("sidebarcommand"); @@ -235,7 +237,7 @@ var Config = Module("config", ConfigBase, { "Handled by " + config.host, function () Events.PASS_THROUGH); }, - options: function (dactyl, modules, window) { + options: function initOptions(dactyl, modules, window) { modules.options.add(["online"], "Enables or disables offline mode", "boolean", true,