Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/ui.js

Issue 9052057: Fixed some sloppy programming causing null access keys to show up in the menu in Firefox 20 (Closed)
Patch Set: Created Dec. 19, 2012, 1:25 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -1636,17 +1636,23 @@ let UI = exports.UI =
let match = /^abp-key-/.exec(item.getAttribute("key"));
if (!match)
continue;
let name = match.input.substr(match.index + match[0].length);
if (!this.hotkeys)
this.configureKeys(window);
if (name in this.hotkeys)
- item.setAttribute("acceltext", KeySelector.getTextForKey(this.hotkeys[name]));
+ {
+ let text = KeySelector.getTextForKey(this.hotkeys[name]);
+ if (text)
+ item.setAttribute("acceltext", text);
+ else
+ item.removeAttribute("acceltext");
+ }
}
hideElement(prefix + "contributebutton", Prefs.hideContributeButton);
},
/**
* Adds Adblock Plus menu items to the content area context menu when it shows
* up.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld