Bug 702159 - Add context menu to exit DOM full screen mode and tests. r=jaws
This commit is contained in:
@@ -54,6 +54,7 @@ nsContextMenu.prototype = {
|
||||
this.initSaveItems();
|
||||
this.initClipboardItems();
|
||||
this.initMediaPlayerItems();
|
||||
this.initLeaveDOMFullScreenItems();
|
||||
},
|
||||
|
||||
initPageMenuSeparator: function CM_initPageMenuSeparator() {
|
||||
@@ -155,6 +156,16 @@ nsContextMenu.prototype = {
|
||||
//this.setItemAttrFromNode( "context-stop", "disabled", "canStop" );
|
||||
},
|
||||
|
||||
initLeaveDOMFullScreenItems: function CM_initLeaveFullScreenItem() {
|
||||
// only show the option if the user is in DOM fullscreen
|
||||
var shouldShow = (this.target.ownerDocument.mozFullScreenElement != null);
|
||||
this.showItem("context-leave-dom-fullscreen", shouldShow);
|
||||
|
||||
// Explicitly show if in DOM fullscreen, but do not hide it has already been shown
|
||||
if (shouldShow)
|
||||
this.showItem("context-media-sep-commands", true);
|
||||
},
|
||||
|
||||
initSaveItems: function CM_initSaveItems() {
|
||||
var shouldShow = !(this.onTextInput || this.onLink ||
|
||||
this.isContentSelected || this.onImage ||
|
||||
@@ -819,6 +830,10 @@ nsContextMenu.prototype = {
|
||||
video.mozRequestFullScreen();
|
||||
},
|
||||
|
||||
leaveDOMFullScreen: function() {
|
||||
document.mozCancelFullScreen();
|
||||
},
|
||||
|
||||
// Change current window to the URL of the background image.
|
||||
viewBGImage: function(e) {
|
||||
urlSecurityCheck(this.bgImageURL,
|
||||
|
||||
Reference in New Issue
Block a user