mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-24 09:27:31 +09:00
Hide and disable open_all/cut/copy/delete/properties when opening
bookmarks/history context menu with no selection This resolves #882 (by not offering options that can't be used)
This commit is contained in:
parent
de0176b22a
commit
aa1fc0720e
6 changed files with 68 additions and 56 deletions
|
|
@ -1341,7 +1341,7 @@ this.PlacesUtils = {
|
|||
* The container node to search through.
|
||||
* @returns true if the node contains uri nodes, false otherwise.
|
||||
*/
|
||||
hasChildURIs: function PU_hasChildURIs(aNode) {
|
||||
hasChildURIs: function PU_hasChildURIs(aNode, aMultiple=false) {
|
||||
if (!this.nodeIsContainer(aNode))
|
||||
return false;
|
||||
|
||||
|
|
@ -1357,11 +1357,14 @@ this.PlacesUtils = {
|
|||
root.containerOpen = true;
|
||||
}
|
||||
|
||||
let foundFirst = !aMultiple;
|
||||
let found = false;
|
||||
for (let i = 0; i < root.childCount && !found; i++) {
|
||||
let child = root.getChild(i);
|
||||
if (this.nodeIsURI(child))
|
||||
found = true;
|
||||
if (this.nodeIsURI(child)) {
|
||||
found = foundFirst;
|
||||
foundFirst = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasOpen) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue