mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-21 09:13:14 +03:00
basic implementation of enhancement request from issue #3
This commit is contained in:
parent
2f938766b3
commit
f602a682f7
@ -629,6 +629,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
|
|
||||||
if ( fullPage ) {
|
if ( fullPage ) {
|
||||||
|
|
||||||
|
requestFullScreen( document.body );
|
||||||
|
|
||||||
this.bodyOverflow = bodyStyle.overflow;
|
this.bodyOverflow = bodyStyle.overflow;
|
||||||
this.docOverflow = docStyle.overflow;
|
this.docOverflow = docStyle.overflow;
|
||||||
bodyStyle.overflow = "hidden";
|
bodyStyle.overflow = "hidden";
|
||||||
@ -686,9 +688,9 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
$.getWindowSize().y - $.getElementSize( this.toolbar.element ).y
|
$.getWindowSize().y - $.getElementSize( this.toolbar.element ).y
|
||||||
) + 'px';
|
) + 'px';
|
||||||
}else{
|
}else{
|
||||||
this.element.style.height = $.getWindowSize().y + 'px';
|
this.element.style.height = '100%';
|
||||||
}
|
}
|
||||||
this.element.style.width = $.getWindowSize().x + 'px';
|
this.element.style.width = '100%';
|
||||||
|
|
||||||
// mouse will be inside container now
|
// mouse will be inside container now
|
||||||
$.delegate( this, onContainerEnter )();
|
$.delegate( this, onContainerEnter )();
|
||||||
@ -696,6 +698,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
cancelFullScreen( document );
|
||||||
|
|
||||||
bodyStyle.overflow = this.bodyOverflow;
|
bodyStyle.overflow = this.bodyOverflow;
|
||||||
docStyle.overflow = this.docOverflow;
|
docStyle.overflow = this.docOverflow;
|
||||||
|
|
||||||
@ -1475,5 +1479,48 @@ function onNext(){
|
|||||||
this.goToPage( next );
|
this.goToPage( next );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
// True "Full Screen" as opposed to "Full Page"
|
||||||
|
// Implementation based on
|
||||||
|
// http://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen/7525760#7525760
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
function cancelFullScreen(el) {
|
||||||
|
var requestMethod = el.cancelFullScreen||el.webkitCancelFullScreen||el.mozCancelFullScreen||el.exitFullscreen;
|
||||||
|
if (requestMethod) { // cancel full screen.
|
||||||
|
requestMethod.call(el);
|
||||||
|
} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
|
||||||
|
var wscript = new ActiveXObject("WScript.Shell");
|
||||||
|
if (wscript !== null) {
|
||||||
|
wscript.SendKeys("{F11}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestFullScreen(el) {
|
||||||
|
// Supports most browsers and their versions.
|
||||||
|
var requestMethod = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;
|
||||||
|
|
||||||
|
if (requestMethod) { // Native full screen.
|
||||||
|
requestMethod.call(el);
|
||||||
|
} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
|
||||||
|
var wscript = new ActiveXObject("WScript.Shell");
|
||||||
|
if (wscript !== null) {
|
||||||
|
wscript.SendKeys("{F11}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleFull() {
|
||||||
|
var elem = document.body; // Make the body go full screen.
|
||||||
|
var isInFullScreen = (document.fullScreenElement && document.fullScreenElement !== null) || (document.mozFullScreen || document.webkitIsFullScreen);
|
||||||
|
|
||||||
|
if (isInFullScreen) {
|
||||||
|
cancelFullScreen(document);
|
||||||
|
} else {
|
||||||
|
requestFullScreen(elem);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}( OpenSeadragon ));
|
}( OpenSeadragon ));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user