mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +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
|
|
@ -109,8 +109,15 @@ PlacesViewBase.prototype = {
|
|||
|
||||
get selectedNode() {
|
||||
if (this._contextMenuShown) {
|
||||
let popup = document.popupNode;
|
||||
return popup._placesNode || popup.parentNode._placesNode || null;
|
||||
let anchor = this._contextMenuShown.triggerNode;
|
||||
if (!anchor)
|
||||
return null;
|
||||
|
||||
if (anchor._placesNode)
|
||||
return this._rootElt == anchor ? null : anchor._placesNode;
|
||||
|
||||
anchor = anchor.parentNode;
|
||||
return this._rootElt == anchor ? null : (anchor._placesNode || null);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
|
@ -176,13 +183,13 @@ PlacesViewBase.prototype = {
|
|||
},
|
||||
|
||||
buildContextMenu: function PVB_buildContextMenu(aPopup) {
|
||||
this._contextMenuShown = true;
|
||||
this._contextMenuShown = aPopup;
|
||||
window.updateCommands("places");
|
||||
return this.controller.buildContextMenu(aPopup);
|
||||
},
|
||||
|
||||
destroyContextMenu: function PVB_destroyContextMenu(aPopup) {
|
||||
this._contextMenuShown = false;
|
||||
this._contextMenuShown = null;
|
||||
},
|
||||
|
||||
_cleanPopup: function PVB_cleanPopup(aPopup, aDelay) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue