зеркало из https://github.com/mozilla/pjs.git
document.getElementsByTagName doesn't find explicitly namespaced nodes b=206053 r=bz sr=mscott
This commit is contained in:
Родитель
81717c666d
Коммит
9ed5cfb597
|
@ -94,10 +94,9 @@
|
|||
{
|
||||
var unavailableActions = this.usedActionsList();
|
||||
// select the first one that's not in the list
|
||||
var menuItems = this.menupopup.getElementsByTagName('menuitem');
|
||||
for (var index = 0; index < menuItems.length; index++)
|
||||
for (var index = 0; index < this.menuitems.length; index++)
|
||||
{
|
||||
var menu = menuItems[index];
|
||||
var menu = this.menuitems[index];
|
||||
if (!(menu.value in unavailableActions) && !menu.hidden)
|
||||
{
|
||||
this.menulist.value = menu.value;
|
||||
|
@ -114,13 +113,14 @@
|
|||
]]>
|
||||
</constructor>
|
||||
|
||||
<field name="menupopup">document.getAnonymousNodes(this)[0].menupopup</field>
|
||||
<field name="menulist">document.getAnonymousNodes(this)[0]</field>
|
||||
<field name="menuitems">this.menulist.getElementsByTagNameNS(this.namespaceURI, 'menuitem')</field>
|
||||
|
||||
<method name="hideInvalidActions">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var scope = getScopeFromFilterList(gFilterList);
|
||||
var menupopup = this.menulist.menupopup;
|
||||
var scope = getScopeFromFilterList(gFilterList);
|
||||
|
||||
// walk through the list of filter actions and hide any actions which aren't valid
|
||||
// for our given scope (news, imap, pop, etc)
|
||||
|
@ -128,15 +128,15 @@
|
|||
|
||||
// disable / enable all elements in the "filteractionlist"
|
||||
// based on the scope and the "enablefornews" attribute
|
||||
elements = this.menupopup.getElementsByAttribute("enablefornews", "true");
|
||||
elements = menupopup.getElementsByAttribute("enablefornews", "true");
|
||||
for (i = 0; i < elements.length; i++)
|
||||
elements[i].hidden = scope != Components.interfaces.nsMsgSearchScope.newsFilter;
|
||||
|
||||
elements = this.menupopup.getElementsByAttribute("enablefornews", "false");
|
||||
elements = menupopup.getElementsByAttribute("enablefornews", "false");
|
||||
for (i = 0; i < elements.length; i++)
|
||||
elements[i].hidden = scope == Components.interfaces.nsMsgSearchScope.newsFilter;
|
||||
|
||||
elements = this.menupopup.getElementsByAttribute("enableforpop3", "true");
|
||||
elements = menupopup.getElementsByAttribute("enableforpop3", "true");
|
||||
for (i = 0; i < elements.length; i++)
|
||||
elements[i].hidden = scope != Components.interfaces.nsMsgSearchScope.offlineMailFilter;
|
||||
]]>
|
||||
|
@ -147,10 +147,9 @@
|
|||
<body>
|
||||
<![CDATA[
|
||||
var numVisibleActions = 0;
|
||||
var menuItems = this.menupopup.getElementsByTagName('menuitem');
|
||||
// only count the items that are visible
|
||||
for (var index = 0; index < menuItems.length; index++)
|
||||
if (!menuItems[index].hidden)
|
||||
for (var index = 0; index < this.menuitems.length; index++)
|
||||
if (!this.menuitems[index].hidden)
|
||||
numVisibleActions++;
|
||||
return numVisibleActions;
|
||||
]]>
|
||||
|
@ -187,10 +186,9 @@
|
|||
<handler event="popupshowing">
|
||||
<![CDATA[
|
||||
var unavailableActions = this.usedActionsList();
|
||||
var menuItems = this.menupopup.getElementsByTagName('menuitem');
|
||||
for (var index = 0; index < menuItems.length; index++)
|
||||
for (var index = 0; index < this.menuitems.length; index++)
|
||||
{
|
||||
var menu = menuItems[index];
|
||||
var menu = this.menuitems[index];
|
||||
menu.setAttribute('disabled', menu.value in unavailableActions);
|
||||
}
|
||||
]]>
|
||||
|
|
Загрузка…
Ссылка в новой задаче