зеркало из https://github.com/mozilla/pjs.git
bug 122144 r=timeless sr=blake
disable 'Translate' menu item for images
This commit is contained in:
Родитель
d43a74e82f
Коммит
f130ceed5c
|
@ -244,7 +244,7 @@
|
|||
<menuitem accesskey="&pageInfoCmd.accesskey;" label="&pageInfoCmd.label;" key="key_viewInfo" command="View:PageInfo"/>
|
||||
<menuseparator />
|
||||
|
||||
<menuitem accesskey="&translateMenu.accesskey;" label="&translateMenu.label;" oncommand="Translate();"/>
|
||||
<menuitem accesskey="&translateMenu.accesskey;" label="&translateMenu.label;" id="menuitem-translate" oncommand="Translate();"/>
|
||||
<menu label="&webContentMenu.label;" accesskey="&webContentMenu.accesskey;">
|
||||
<menupopup datasources="rdf:chrome" ref="urn:mozilla:locale:root"
|
||||
sortResource="http://www.mozilla.org/rdf/chrome#name"
|
||||
|
|
|
@ -109,6 +109,7 @@ nsBrowserStatusHandler.prototype =
|
|||
this.stopMenu = document.getElementById("menuitem-stop");
|
||||
this.stopContext = document.getElementById("context-stop");
|
||||
this.statusTextField = document.getElementById("statusbar-display");
|
||||
this.translateMenu = document.getElementById("menuitem-translate");
|
||||
|
||||
},
|
||||
|
||||
|
@ -122,6 +123,7 @@ nsBrowserStatusHandler.prototype =
|
|||
this.stopMenu = null;
|
||||
this.stopContext = null;
|
||||
this.statusTextField = null;
|
||||
this.translateMenu = null;
|
||||
this.userTyped = null;
|
||||
},
|
||||
|
||||
|
@ -214,6 +216,7 @@ nsBrowserStatusHandler.prototype =
|
|||
this.stopButton.disabled = false;
|
||||
this.stopMenu.removeAttribute('disabled');
|
||||
this.stopContext.removeAttribute('disabled');
|
||||
this.translateMenu.removeAttribute('disabled');
|
||||
|
||||
// Initialize the progress stuff...
|
||||
this.useRealProgressFlag = false;
|
||||
|
@ -247,6 +250,9 @@ nsBrowserStatusHandler.prototype =
|
|||
}
|
||||
this.status = "";
|
||||
this.setDefaultStatus(msg);
|
||||
var ctype = aRequest.QueryInterface(nsIChannel).contentType;
|
||||
if (ctype.match(/^image\//))
|
||||
this.translateMenu.setAttribute('disabled', 'true');
|
||||
}
|
||||
|
||||
// Turn the progress meter and throbber off.
|
||||
|
|
Загрузка…
Ссылка в новой задаче