mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
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:
parent
780a1792ac
commit
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;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user