mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Moved Viewport.goHome to Viewer.goHome.
This commit is contained in:
parent
66b8d7e191
commit
5c7c1d5b6c
@ -333,7 +333,7 @@ $.Viewer = function( options ) {
|
||||
_this.viewport.applyConstraints();
|
||||
return false;
|
||||
case 48://0|)
|
||||
_this.viewport.goHome();
|
||||
_this.goHome();
|
||||
_this.viewport.applyConstraints();
|
||||
return false;
|
||||
case 119://w
|
||||
@ -622,6 +622,28 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
this.element = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @param {Boolean} immediately
|
||||
* @fires OpenSeadragon.Viewer.event:home
|
||||
*/
|
||||
goHome: function(immediately) {
|
||||
/**
|
||||
* Raised when the "home" operation occurs (see {@link OpenSeadragon.Viewport#goHome}).
|
||||
*
|
||||
* @event home
|
||||
* @memberof OpenSeadragon.Viewer
|
||||
* @type {object}
|
||||
* @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.
|
||||
* @property {Boolean} immediately
|
||||
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
*/
|
||||
this.raiseEvent( 'home', {
|
||||
immediately: immediately
|
||||
});
|
||||
|
||||
this.viewport.fitBounds( this.world.getHomeBounds(), immediately );
|
||||
},
|
||||
|
||||
/**
|
||||
* @function
|
||||
@ -1929,6 +1951,7 @@ function openTileSource( viewer, source, options ) {
|
||||
});
|
||||
|
||||
_this.world.addItem( tiledImage );
|
||||
_this.goHome( true );
|
||||
|
||||
// Now that we have a drawer, see if it supports rotate. If not we need to remove the rotate buttons
|
||||
if (!_this.drawer.canRotate()) {
|
||||
@ -2793,9 +2816,7 @@ function lightUp() {
|
||||
|
||||
|
||||
function onHome() {
|
||||
if ( this.viewport ) {
|
||||
this.viewport.goHome();
|
||||
}
|
||||
this.goHome();
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,7 +105,6 @@ $.Viewport = function( options ) {
|
||||
});
|
||||
|
||||
this.resetContentSize( this.contentSize );
|
||||
this.goHome( true );
|
||||
this.update();
|
||||
};
|
||||
|
||||
@ -178,26 +177,15 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @param {Boolean} immediately
|
||||
* @fires OpenSeadragon.Viewer.event:home
|
||||
* @private
|
||||
*/
|
||||
goHome: function( immediately ) {
|
||||
$.console.error("[Viewport.goHome] this function is deprecated; use Viewer.goHome instead");
|
||||
if( this.viewer ){
|
||||
/**
|
||||
* Raised when the "home" operation occurs (see {@link OpenSeadragon.Viewport#goHome}).
|
||||
*
|
||||
* @event home
|
||||
* @memberof OpenSeadragon.Viewer
|
||||
* @type {object}
|
||||
* @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.
|
||||
* @property {Boolean} immediately
|
||||
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
*/
|
||||
this.viewer.raiseEvent( 'home', {
|
||||
immediately: immediately
|
||||
});
|
||||
this.viewer.goHome(immediately);
|
||||
}
|
||||
return this.fitBounds( this.getHomeBounds(), immediately );
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -133,7 +133,7 @@
|
||||
};
|
||||
|
||||
viewer.addHandler('animation-finish', homeHandler);
|
||||
viewport.goHome(true);
|
||||
viewer.goHome(true);
|
||||
}
|
||||
|
||||
viewer.addHandler("open", opener);
|
||||
|
@ -38,6 +38,7 @@
|
||||
var addLayerHandler = function( event ) {
|
||||
if ( event.options === options ) {
|
||||
self.viewer.removeHandler( "add-layer", addLayerHandler );
|
||||
self.viewer.goHome();
|
||||
}
|
||||
};
|
||||
this.viewer.addHandler( "add-layer", addLayerHandler );
|
||||
|
@ -105,7 +105,7 @@
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
_viewer.viewport.goHome();
|
||||
_viewer.goHome();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -270,7 +270,7 @@
|
||||
waitForViewer( function() {
|
||||
checkOverlayPosition( "after zoom and pan using image coordinates" );
|
||||
|
||||
viewer.viewport.goHome();
|
||||
viewer.goHome();
|
||||
waitForViewer( function() {
|
||||
checkOverlayPosition( "after goHome using image coordinates" );
|
||||
start();
|
||||
@ -333,7 +333,7 @@
|
||||
waitForViewer( function() {
|
||||
checkOverlayPosition( "after zoom and pan using viewport coordinates" );
|
||||
|
||||
viewer.viewport.goHome();
|
||||
viewer.goHome();
|
||||
waitForViewer( function() {
|
||||
checkOverlayPosition( "after goHome using viewport coordinates" );
|
||||
start();
|
||||
|
Loading…
Reference in New Issue
Block a user