From 53497c4ebc65aa07f059aba7cd955c4f5d39183e Mon Sep 17 00:00:00 2001 From: "rj.keller%beonex.com" Date: Tue, 8 Mar 2005 23:04:47 +0000 Subject: [PATCH] Bug 251751 - Firefox Help window should not be alwaysRaised r=mconnor@myrealbox.com --- toolkit/components/help/content/help.js | 32 +++++++++++++++++++ toolkit/components/help/content/help.xul | 4 +++ .../help/content/helpContextOverlay.xul | 10 ++++++ toolkit/components/help/locale/en-US/help.dtd | 3 ++ 4 files changed, 49 insertions(+) diff --git a/toolkit/components/help/content/help.js b/toolkit/components/help/content/help.js index f0cda19a1e2..328a63cc341 100644 --- a/toolkit/components/help/content/help.js +++ b/toolkit/components/help/content/help.js @@ -867,3 +867,35 @@ function showRelativePanel(goForward) { sidebarButtons[selectedIndex].doCommand(); } +# getXulWin - Returns the current Help window as a nsIXULWindow. +function getXulWin() +{ + window.QueryInterface(Components.interfaces.nsIInterfaceRequestor); + var webnav = window.getInterface(Components.interfaces.nsIWebNavigation); + var dsti = webnav.QueryInterface(Components.interfaces.nsIDocShellTreeItem); + var treeowner = dsti.treeOwner; + var ifreq = treeowner.QueryInterface(Components.interfaces.nsIInterfaceRequestor); + + return ifreq.getInterface(Components.interfaces.nsIXULWindow); +} + +# toggleZLevel - Toggles whether or not the window will always appear on top. Because +# alwaysRaised is not supported on an OS other than windows, this code will not +# appear in those builds. +# +# element - The DOM node that persists the checked state. +#ifdef XP_WIN +function toggleZLevel(element) +{ + var xulwin = getXulWin(); + + // Now we can flip the zLevel, and set the attribute so that it persists correctly + if (xulwin.zLevel > xulwin.normalZ) { + xulwin.zLevel = xulwin.normalZ; + element.setAttribute("checked", "false"); + } else { + xulwin.zLevel = xulwin.raisedZ; + element.setAttribute("checked", "true"); + } +} +#endif diff --git a/toolkit/components/help/content/help.xul b/toolkit/components/help/content/help.xul index 59fad2e7b95..acbe59de493 100644 --- a/toolkit/components/help/content/help.xul +++ b/toolkit/components/help/content/help.xul @@ -60,7 +60,11 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="700" height="550" +#ifdef XP_WIN + persist="width height screenX screenY zlevel" +#else persist="width height screenX screenY" +#endif onload="init();" onunload="uninitFindBar(); window.XULBrowserWindow.destroy();"> diff --git a/toolkit/components/help/content/helpContextOverlay.xul b/toolkit/components/help/content/helpContextOverlay.xul index 7de72891505..80958c52947 100644 --- a/toolkit/components/help/content/helpContextOverlay.xul +++ b/toolkit/components/help/content/helpContextOverlay.xul @@ -68,6 +68,16 @@ label="&textZoomReduceBtn.label;" accesskey="&textZoomReduceBtn.accesskey;" oncommand="ZoomManager.prototype.getInstance().reduce();"/> +#ifdef XP_WIN + + +#endif diff --git a/toolkit/components/help/locale/en-US/help.dtd b/toolkit/components/help/locale/en-US/help.dtd index 7cc04760f3a..e3e0a6defc0 100644 --- a/toolkit/components/help/locale/en-US/help.dtd +++ b/toolkit/components/help/locale/en-US/help.dtd @@ -54,3 +54,6 @@ + + +