Bug 272800 Make various bookmarks menus middle-clickable

r=timeless sr=neil
This commit is contained in:
cst%andrew.cmu.edu 2005-02-25 02:38:57 +00:00
Родитель 99487d7e26
Коммит 021e5d6aad
3 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -292,6 +292,7 @@
datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
ref="NC:BookmarksRoot" container="true" flags="dont-test-empty"
oncommand="BookmarksMenu.loadBookmark(event, this.database)"
onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
template="bookmarksMenuTemplate"
ondraggesture="if (event.target.id=='bookmarks-button') event.preventBubble()">
<menupopup onpopupshowing="updateGroupmarkMenuitem('PT_bookmarks_groupmark');">
@ -310,7 +311,7 @@
datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
ref="NC:PersonalToolbarFolder" flags="dont-test-empty"
oncommand="BookmarksUtils.loadBookmarkBrowser(event, this.database)"
onclick="if (event.button == 1) BookmarksUtils.loadBookmarkBrowser(event, this.database)"
onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
rdf:type="http://home.netscape.com/NC-rdf#Folder">
</hbox>
<hbox class="bookmarks-toolbar-overflow-items" mousethrough="always">
@ -320,7 +321,8 @@
datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
template="bookmarksMenuTemplate"
ref="NC:PersonalToolbarFolder" flags="dont-test-empty"
oncommand="BookmarksUtils.loadBookmarkBrowser(event, this.database)">
oncommand="BookmarksUtils.loadBookmarkBrowser(event, this.database)"
onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)">
<menupopup id="bookmarks-chevron-popup"
onpopupshowing="if (event.target == this) BookmarksToolbar.updateOverflowMenu(this);"/>
</toolbarbutton>

Просмотреть файл

@ -458,6 +458,7 @@
datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
ref="NC:BookmarksRoot" flags="dont-test-empty" template="bookmarksMenuTemplate"
oncommand="BookmarksMenu.loadBookmark(event, this.database)"
onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.preventBubble()"
ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.preventBubble()"

Просмотреть файл

@ -275,6 +275,19 @@ var BookmarksMenu = {
{
if (this.isBTBookmark(aEvent.target.id))
BookmarksUtils.loadBookmarkBrowser(aEvent, aDS);
},
loadBookmarkMiddleClick: function (aEvent, aDS)
{
if (aEvent.type != "click" || aEvent.button != 1)
return;
// unlike for command events, we have to close the menus manually
for (var node = aEvent.target; node != aEvent.currentTarget;
node = node.parentNode) {
if (node.nodeType == node.ELEMENT_NODE && node.tagName == "menupopup")
node.hidePopup();
}
this.loadBookmark(aEvent, aDS);
}
}