Bug 1249473 - Right-clicking a recent bookmark shouldn't load it. r=mak
authorDão Gottwald <dao@mozilla.com>
Fri, 19 Feb 2016 15:10:17 +0100
changeset 321289 26771bc857f867ab6fa34c7a6ec87f92e79ce4e8
parent 321288 164d5bc71555fe593f7726ff208dccb730073f34
child 321290 7ba6d7255327b319ada588bfa65787cb1b5acba3
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1249473
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1249473 - Right-clicking a recent bookmark shouldn't load it. r=mak
browser/base/content/browser-places.js
browser/components/customizableui/CustomizableWidgets.jsm
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1354,17 +1354,17 @@ var BookmarkingUI = {
     while (aHeaderItem.nextSibling &&
            aHeaderItem.nextSibling.localName == "menuitem") {
       aHeaderItem.nextSibling.remove();
     }
 
     PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
                        .asyncExecuteLegacyQueries([query], 1, options, {
       handleResult: function (aResultSet) {
-        let onItemClick = function (aEvent) {
+        let onItemCommand = function (aEvent) {
           let item = aEvent.target;
           openUILink(item.getAttribute("targetURI"), aEvent);
           CustomizableUI.hidePanelForNode(item);
         };
 
         let fragment = document.createDocumentFragment();
         let row;
         while ((row = aResultSet.getNextRow())) {
@@ -1374,17 +1374,17 @@ var BookmarkingUI = {
 
           let item =
             document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
                                      "menuitem");
           item.setAttribute("label", title || uri);
           item.setAttribute("targetURI", uri);
           item.setAttribute("class", "menuitem-iconic menuitem-with-favicon bookmark-item " +
                                      extraCSSClass);
-          item.addEventListener("click", onItemClick);
+          item.addEventListener("command", onItemCommand);
           if (icon) {
             let iconURL = "moz-anno:favicon:" + icon;
             item.setAttribute("image", iconURL);
           }
           fragment.appendChild(item);
         }
         aHeaderItem.parentNode.insertBefore(fragment, aHeaderItem.nextSibling);
       },
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -198,33 +198,33 @@ const CustomizableWidgets = [
       // Get all statically placed buttons to supply them with keyboard shortcuts.
       let staticButtons = items.parentNode.getElementsByTagNameNS(kNSXUL, "toolbarbutton");
       for (let i = 0, l = staticButtons.length; i < l; ++i)
         CustomizableUI.addShortcut(staticButtons[i]);
 
       PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
                          .asyncExecuteLegacyQueries([query], 1, options, {
         handleResult: function (aResultSet) {
-          let onItemClick = function (aEvent) {
+          let onItemCommand = function (aEvent) {
             let item = aEvent.target;
             win.openUILink(item.getAttribute("targetURI"), aEvent);
             CustomizableUI.hidePanelForNode(item);
           };
           let fragment = doc.createDocumentFragment();
           let row;
           while ((row = aResultSet.getNextRow())) {
             let uri = row.getResultByIndex(1);
             let title = row.getResultByIndex(2);
             let icon = row.getResultByIndex(6);
 
             let item = doc.createElementNS(kNSXUL, "toolbarbutton");
             item.setAttribute("label", title || uri);
             item.setAttribute("targetURI", uri);
             item.setAttribute("class", "subviewbutton");
-            item.addEventListener("click", onItemClick);
+            item.addEventListener("command", onItemCommand);
             if (icon) {
               let iconURL = "moz-anno:favicon:" + icon;
               item.setAttribute("image", iconURL);
             }
             fragment.appendChild(item);
           }
           items.appendChild(fragment);
         },