зеркало из https://github.com/mozilla/gecko-dev.git
108595 - Add a method for determining whether or not a context menu separator should be shown by determining if there are any items prior to the separator that are not hidden. r=kerz, sr=blake
This commit is contained in:
Родитель
780a1792ac
Коммит
2a09c75163
|
@ -745,5 +745,22 @@ nsContextMenu.prototype = {
|
|||
} else {
|
||||
return(node.localName.toUpperCase() == "TEXTAREA");
|
||||
}
|
||||
},
|
||||
|
||||
// Determines whether or not the separator with the specified ID should be
|
||||
// shown or not by determining if there are any non-hidden items between it
|
||||
// and the previous separator.
|
||||
shouldShowSeparator : function ( aSeparatorID )
|
||||
{
|
||||
var separator = document.getElementById(aSeparatorID);
|
||||
if (separator) {
|
||||
var sibling = separator.previousSibling;
|
||||
while (sibling && sibling.localName != "menuseparator") {
|
||||
if (sibling.getAttribute("hidden") != "true")
|
||||
return true;
|
||||
sibling = sibling.previousSibling;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче