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:
thatcher 2013-02-26 22:34:44 -05:00
parent f602a682f7
commit d4b02e1aba
2 changed files with 31 additions and 5 deletions

View File

@ -481,7 +481,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
maxZoomLevel: null,
//UI RESPONSIVENESS AND FEEL
springStiffness: 5.0,
springStiffness: 7.0,
clickTimeThreshold: 300,
clickDistThreshold: 5,
zoomPerClick: 2.0,
@ -490,13 +490,13 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
animationTime: 1.5,
blendTime: 1.5,
alwaysBlend: false,
autoHideControls: true,
immediateRender: false,
immediateRender: true,
//DEFAULT CONTROL SETTINGS
showSequenceControl: true, //SEQUENCE
preserveViewport: false, //SEQUENCE
showNavigationControl: true, //ZOOM/HOME/FULL/SEQUENCE
autoHideControls: true,
controlsFadeDelay: 2000, //ZOOM/HOME/FULL/SEQUENCE
controlsFadeLength: 1500, //ZOOM/HOME/FULL/SEQUENCE
mouseNavEnabled: true, //GENERAL MOUSE INTERACTIVITY

View File

@ -615,6 +615,7 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
docStyle = document.documentElement.style,
containerStyle = this.element.style,
canvasStyle = this.canvas.style,
_this = this,
oldBounds,
newBounds,
viewer,
@ -626,11 +627,31 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
if ( fullPage == this.isFullPage() ) {
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 ) {
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.docOverflow = docStyle.overflow;
bodyStyle.overflow = "hidden";
@ -698,7 +719,9 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
} 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;
docStyle.overflow = this.docOverflow;
@ -750,6 +773,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
// mouse will likely be outside now
$.delegate( this, onContainerExit )();
cancelFullScreen( document );
}
this.raiseEvent( 'fullpage', { fullpage: fullPage, viewer: this } );
@ -1523,4 +1548,5 @@ function toggleFull() {
return false;
}
}( OpenSeadragon ));