mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-31 23:21:42 +03:00
managed to get a more complete, though hacky, implementation of #3. the big sticky point was how firefox and safari beahved when switching between applications when already in full screen mode. because we didnt have an event listener for fullscreenchange, and because those browsers released full screen on application or window change (think alt+tab or cmd+tab), you would come back to a empty document. more work left here to make this worth merging into master
This commit is contained in:
parent
f602a682f7
commit
d4b02e1aba
@ -481,7 +481,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
maxZoomLevel: null,
|
maxZoomLevel: null,
|
||||||
|
|
||||||
//UI RESPONSIVENESS AND FEEL
|
//UI RESPONSIVENESS AND FEEL
|
||||||
springStiffness: 5.0,
|
springStiffness: 7.0,
|
||||||
clickTimeThreshold: 300,
|
clickTimeThreshold: 300,
|
||||||
clickDistThreshold: 5,
|
clickDistThreshold: 5,
|
||||||
zoomPerClick: 2.0,
|
zoomPerClick: 2.0,
|
||||||
@ -490,13 +490,13 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
animationTime: 1.5,
|
animationTime: 1.5,
|
||||||
blendTime: 1.5,
|
blendTime: 1.5,
|
||||||
alwaysBlend: false,
|
alwaysBlend: false,
|
||||||
autoHideControls: true,
|
immediateRender: true,
|
||||||
immediateRender: false,
|
|
||||||
|
|
||||||
//DEFAULT CONTROL SETTINGS
|
//DEFAULT CONTROL SETTINGS
|
||||||
showSequenceControl: true, //SEQUENCE
|
showSequenceControl: true, //SEQUENCE
|
||||||
preserveViewport: false, //SEQUENCE
|
preserveViewport: false, //SEQUENCE
|
||||||
showNavigationControl: true, //ZOOM/HOME/FULL/SEQUENCE
|
showNavigationControl: true, //ZOOM/HOME/FULL/SEQUENCE
|
||||||
|
autoHideControls: true,
|
||||||
controlsFadeDelay: 2000, //ZOOM/HOME/FULL/SEQUENCE
|
controlsFadeDelay: 2000, //ZOOM/HOME/FULL/SEQUENCE
|
||||||
controlsFadeLength: 1500, //ZOOM/HOME/FULL/SEQUENCE
|
controlsFadeLength: 1500, //ZOOM/HOME/FULL/SEQUENCE
|
||||||
mouseNavEnabled: true, //GENERAL MOUSE INTERACTIVITY
|
mouseNavEnabled: true, //GENERAL MOUSE INTERACTIVITY
|
||||||
|
@ -615,6 +615,7 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
docStyle = document.documentElement.style,
|
docStyle = document.documentElement.style,
|
||||||
containerStyle = this.element.style,
|
containerStyle = this.element.style,
|
||||||
canvasStyle = this.canvas.style,
|
canvasStyle = this.canvas.style,
|
||||||
|
_this = this,
|
||||||
oldBounds,
|
oldBounds,
|
||||||
newBounds,
|
newBounds,
|
||||||
viewer,
|
viewer,
|
||||||
@ -626,11 +627,31 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
if ( fullPage == this.isFullPage() ) {
|
if ( fullPage == this.isFullPage() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.tmp = function( event ) {
|
||||||
|
// The event object doesn't carry information about the fullscreen state of the browser,
|
||||||
|
// but it is possible to retrieve it through the fullscreen API
|
||||||
|
if( (document.fullScreenElement && document.fullScreenElement !== null) ||
|
||||||
|
(document.mozFullScreen || document.webkitIsFullScreen) ){
|
||||||
|
console.log( document.webkitIsFullScreen );
|
||||||
|
// The target of the event is always the document,
|
||||||
|
// but it is possible to retrieve the fullscreen element through the API
|
||||||
|
if( !_this.isFullPage() ){
|
||||||
|
_this.setFullPage( true );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_this.setFullPage( false );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if ( fullPage ) {
|
if ( fullPage ) {
|
||||||
|
|
||||||
requestFullScreen( document.body );
|
requestFullScreen( document.body );
|
||||||
|
|
||||||
|
|
||||||
|
// Note that the API is still vendor-prefixed in browsers implementing it
|
||||||
|
document.addEventListener("mozfullscreenchange", this.tmp);
|
||||||
|
document.addEventListener("webkitfullscreenchange", this.tmp);
|
||||||
|
|
||||||
this.bodyOverflow = bodyStyle.overflow;
|
this.bodyOverflow = bodyStyle.overflow;
|
||||||
this.docOverflow = docStyle.overflow;
|
this.docOverflow = docStyle.overflow;
|
||||||
bodyStyle.overflow = "hidden";
|
bodyStyle.overflow = "hidden";
|
||||||
@ -698,7 +719,9 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
cancelFullScreen( document );
|
// Note that the API is still vendor-prefixed in browsers implementing it
|
||||||
|
document.removeEventListener("mozfullscreenchange", this.tmp);
|
||||||
|
document.removeEventListener("webkitfullscreenchange", this.tmp);
|
||||||
|
|
||||||
bodyStyle.overflow = this.bodyOverflow;
|
bodyStyle.overflow = this.bodyOverflow;
|
||||||
docStyle.overflow = this.docOverflow;
|
docStyle.overflow = this.docOverflow;
|
||||||
@ -750,6 +773,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
// mouse will likely be outside now
|
// mouse will likely be outside now
|
||||||
$.delegate( this, onContainerExit )();
|
$.delegate( this, onContainerExit )();
|
||||||
|
|
||||||
|
cancelFullScreen( document );
|
||||||
|
|
||||||
}
|
}
|
||||||
this.raiseEvent( 'fullpage', { fullpage: fullPage, viewer: this } );
|
this.raiseEvent( 'fullpage', { fullpage: fullPage, viewer: this } );
|
||||||
|
|
||||||
@ -1523,4 +1548,5 @@ function toggleFull() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}( OpenSeadragon ));
|
}( OpenSeadragon ));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user