зеркало из https://github.com/mozilla/pjs.git
Bug 138074 context menu for Image as URL doesn't match spec
r=caillon sr=jag
This commit is contained in:
Родитель
20dc438569
Коммит
8c82b52daf
|
@ -113,15 +113,17 @@ nsContextMenu.prototype = {
|
|||
//this.setItemAttrFromNode( "context-stop", "disabled", "canStop" );
|
||||
},
|
||||
initSaveItems : function () {
|
||||
this.showItem( "context-savepage", !( this.inDirList || this.isTextSelected || this.onTextInput ) && !( this.onLink && this.onImage ) );
|
||||
this.showItem( "context-savepage",
|
||||
!( this.inDirList || this.isTextSelected || this.onTextInput || this.onStandaloneImage ||
|
||||
(this.onLink && this.onImage)));
|
||||
|
||||
// Save link depends on whether we're in a link.
|
||||
this.showItem( "context-savelink", this.onSaveableLink );
|
||||
|
||||
// Save image depends on whether there is one.
|
||||
this.showItem( "context-saveimage", this.onImage );
|
||||
this.showItem( "context-saveimage", this.onImage || this.onStandaloneImage);
|
||||
|
||||
this.showItem( "context-sendimage", this.onImage );
|
||||
this.showItem( "context-sendimage", this.onImage || this.onStandaloneImage);
|
||||
},
|
||||
initViewItems : function () {
|
||||
// View source is always OK, unless in directory listing.
|
||||
|
@ -136,9 +138,9 @@ nsContextMenu.prototype = {
|
|||
this.showItem( "context-sep-properties", !( this.inDirList || this.isTextSelected || this.onTextInput ) );
|
||||
// Set As Wallpaper depends on whether an image was clicked on, and only works on Windows.
|
||||
var isWin = navigator.appVersion.indexOf("Windows") != -1;
|
||||
this.showItem( "context-setWallpaper", isWin && this.onImage );
|
||||
this.showItem( "context-setWallpaper", isWin && (this.onImage || this.onStandaloneImage));
|
||||
|
||||
this.showItem( "context-sep-image", this.onImage );
|
||||
this.showItem( "context-sep-image", this.onImage || this.onStandaloneImage);
|
||||
|
||||
if( isWin && this.onImage )
|
||||
// Disable the Set As Wallpaper menu item if we're still trying to load the image
|
||||
|
@ -154,13 +156,13 @@ nsContextMenu.prototype = {
|
|||
this.showItem( "context-viewimage", this.onImage && !this.onStandaloneImage);
|
||||
|
||||
// View background image depends on whether there is one.
|
||||
this.showItem( "context-viewbgimage", showView );
|
||||
this.showItem( "context-sep-viewbgimage", showView );
|
||||
this.showItem( "context-viewbgimage", showView && !this.onStandaloneImage);
|
||||
this.showItem( "context-sep-viewbgimage", showView && !this.onStandaloneImage);
|
||||
this.setItemAttr( "context-viewbgimage", "disabled", this.hasBGImage ? null : "true");
|
||||
},
|
||||
initMiscItems : function () {
|
||||
// Use "Bookmark This Link" if on a link.
|
||||
this.showItem( "context-bookmarkpage", !( this.isTextSelected || this.onTextInput ) );
|
||||
this.showItem( "context-bookmarkpage", !( this.isTextSelected || this.onTextInput || this.onStandaloneImage ) );
|
||||
this.showItem( "context-bookmarklink", this.onLink && !this.onMailtoLink );
|
||||
this.showItem( "context-searchselect", this.isTextSelected && !this.onTextInput );
|
||||
this.showItem( "frame", this.inFrame );
|
||||
|
|
Загрузка…
Ссылка в новой задаче