Bug 131429. The context menu item for 'Set as Wallpaper' on Windows platforms should be disabled while the image is loading, in order to prevent a partial image being set. r=biesi, sr=blake.
git-svn-id: svn://10.0.0.236/trunk@205636 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2181db6808
commit
9958bdfb5e
@ -121,10 +121,21 @@ 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.
|
||||
this.showItem( "context-setWallpaper", this.onImage && navigator.appVersion.indexOf("Windows") != -1);
|
||||
|
||||
var isWin = navigator.appVersion.indexOf("Windows") != -1;
|
||||
this.showItem( "context-setWallpaper", isWin && this.onImage );
|
||||
|
||||
this.showItem( "context-sep-image", this.onImage );
|
||||
|
||||
if( isWin && this.onImage ) {
|
||||
var wallpaperItem = document.getElementById("context-setWallpaper");
|
||||
// Disable the Set As Wallpaper menu item if we're still trying to load the image
|
||||
if( !("complete" in this.target) || this.target.complete ) {
|
||||
wallpaperItem.removeAttribute("disabled");
|
||||
} else {
|
||||
wallpaperItem.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
|
||||
// View Image depends on whether an image was clicked on.
|
||||
this.showItem( "context-viewimage", this.onImage );
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user