зеркало из https://github.com/mozilla/gecko-dev.git
Don't underline XUL access keys on Mac. Bug 277463, patch by Asaf Romano <bugs.mano@mail-central.com>, r=mconnor.
This commit is contained in:
Родитель
f0c687fa96
Коммит
da60d106a0
|
@ -29,6 +29,9 @@
|
|||
|
||||
<binding id="text-label" extends="chrome://global/content/bindings/text.xml#text-base">
|
||||
<implementation implements="nsIDOMXULLabelElement">
|
||||
<field name="mUnderlineAccesskey">
|
||||
!/Mac/.test(navigator.platform)
|
||||
</field>
|
||||
<property name="accessKey">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
|
@ -63,6 +66,12 @@
|
|||
<implementation implements="nsIDOMXULLabelElement">
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
try {
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
this.mUnderlineAccesskey = (prefs.getIntPref("ui.key.menuAccessKey") != 0);
|
||||
}
|
||||
catch (e) { }
|
||||
this.formatAccessKey();
|
||||
]]>
|
||||
</constructor>
|
||||
|
@ -70,6 +79,9 @@
|
|||
<method name="formatAccessKey">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!this.mUnderlineAccesskey)
|
||||
return;
|
||||
|
||||
var control = this.labeledControlElement;
|
||||
if (!control) {
|
||||
var bindingParent = document.getBindingParent(this);
|
||||
|
|
Загрузка…
Ссылка в новой задаче