Bug 328156 - Window menu: blank line for open About box, r=mano

This commit is contained in:
Markus Amalthea Magnuson 2010-01-05 18:35:58 -05:00
parent d85823fed6
commit 49df520432
3 changed files with 6 additions and 6 deletions

View file

@ -57,6 +57,7 @@
windowtype="Browser:About" windowtype="Browser:About"
onload="init(event);" onunload="uninit(event);" onload="init(event);" onunload="uninit(event);"
#ifdef XP_MACOSX #ifdef XP_MACOSX
inwindowmenu="false"
buttons="extra2" buttons="extra2"
align="end" align="end"
#else #else

View file

@ -16,7 +16,7 @@
<menu id="windowMenu" <menu id="windowMenu"
label="&windowMenu.label;" label="&windowMenu.label;"
datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot" datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot"
onpopupshowing="checkFocusedWindow();" onpopupshowing="macWindowMenuDidShow();"
hidden="false"> hidden="false">
<template> <template>
<rule> <rule>

View file

@ -35,21 +35,20 @@
# #
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
function checkFocusedWindow() function macWindowMenuDidShow()
{ {
var windowManagerDS = var windowManagerDS =
Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'] Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator']
.getService(Components.interfaces.nsIWindowDataSource); .getService(Components.interfaces.nsIWindowDataSource);
var sep = document.getElementById("sep-window-list"); var sep = document.getElementById("sep-window-list");
// Using double parens to avoid warning // Using double parens to avoid warning
while ((sep = sep.nextSibling)) { while ((sep = sep.nextSibling)) {
var url = sep.getAttribute('id'); var url = sep.getAttribute('id');
var win = windowManagerDS.getWindowForResource(url); var win = windowManagerDS.getWindowForResource(url);
if (win == window) { if (win.document.documentElement.getAttribute("inwindowmenu") == "false")
sep.hidden = true;
else if (win == window)
sep.setAttribute("checked", "true"); sep.setAttribute("checked", "true");
break;
}
} }
} }