2013-05-01 08:46:16 +04:00
|
|
|
/*
|
2013-05-14 08:00:24 +04:00
|
|
|
* OpenSeadragon - Navigator
|
2013-05-01 08:46:16 +04:00
|
|
|
*
|
|
|
|
* Copyright (C) 2009 CodePlex Foundation
|
2013-05-14 07:32:09 +04:00
|
|
|
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
2013-05-01 08:46:16 +04:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
* met:
|
|
|
|
*
|
|
|
|
* - Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* - Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* - Neither the name of CodePlex Foundation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2012-03-07 07:20:00 +04:00
|
|
|
(function( $ ){
|
2013-06-19 21:33:25 +04:00
|
|
|
|
2012-03-07 07:20:00 +04:00
|
|
|
/**
|
2013-11-25 20:48:44 +04:00
|
|
|
* @class Navigator
|
|
|
|
* @classdesc The Navigator provides a small view of the current image as fixed
|
2012-04-11 01:02:24 +04:00
|
|
|
* while representing the viewport as a moving box serving as a frame
|
|
|
|
* of reference in the larger viewport as to which portion of the image
|
2013-01-31 22:18:32 +04:00
|
|
|
* is currently being examined. The navigator's viewport can be interacted
|
2012-04-11 01:02:24 +04:00
|
|
|
* with using the keyboard or the mouse.
|
2013-11-25 20:48:44 +04:00
|
|
|
*
|
2013-11-16 10:19:53 +04:00
|
|
|
* @memberof OpenSeadragon
|
2012-04-11 01:02:24 +04:00
|
|
|
* @extends OpenSeadragon.Viewer
|
2013-09-25 00:36:13 +04:00
|
|
|
* @extends OpenSeadragon.EventSource
|
2012-03-07 07:20:00 +04:00
|
|
|
* @param {Object} options
|
|
|
|
*/
|
|
|
|
$.Navigator = function( options ){
|
|
|
|
|
2013-06-19 01:55:19 +04:00
|
|
|
var viewer = options.viewer,
|
2014-08-15 12:46:27 +04:00
|
|
|
_this = this,
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
viewerSize,
|
2014-01-19 06:19:22 +04:00
|
|
|
navigatorSize,
|
2013-04-05 06:30:59 +04:00
|
|
|
unneededElement;
|
2013-03-16 06:29:27 +04:00
|
|
|
|
2012-03-07 07:20:00 +04:00
|
|
|
//We may need to create a new element and id if they did not
|
|
|
|
//provide the id for the existing element
|
|
|
|
if( !options.id ){
|
2013-06-21 00:23:16 +04:00
|
|
|
options.id = 'navigator-' + $.now();
|
2012-03-16 19:36:28 +04:00
|
|
|
this.element = $.makeNeutralElement( "div" );
|
2013-08-08 08:12:44 +04:00
|
|
|
options.controlOptions = {
|
|
|
|
anchor: $.ControlAnchor.TOP_RIGHT,
|
|
|
|
attachToViewer: true,
|
|
|
|
autoFade: true
|
|
|
|
};
|
|
|
|
|
|
|
|
if( options.position ){
|
|
|
|
if( 'BOTTOM_RIGHT' == options.position ){
|
|
|
|
options.controlOptions.anchor = $.ControlAnchor.BOTTOM_RIGHT;
|
|
|
|
} else if( 'BOTTOM_LEFT' == options.position ){
|
|
|
|
options.controlOptions.anchor = $.ControlAnchor.BOTTOM_LEFT;
|
|
|
|
} else if( 'TOP_RIGHT' == options.position ){
|
|
|
|
options.controlOptions.anchor = $.ControlAnchor.TOP_RIGHT;
|
|
|
|
} else if( 'TOP_LEFT' == options.position ){
|
|
|
|
options.controlOptions.anchor = $.ControlAnchor.TOP_LEFT;
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
} else if( 'ABSOLUTE' == options.position ){
|
|
|
|
options.controlOptions.anchor = $.ControlAnchor.ABSOLUTE;
|
|
|
|
options.controlOptions.top = options.top;
|
|
|
|
options.controlOptions.left = options.left;
|
|
|
|
options.controlOptions.height = options.height;
|
|
|
|
options.controlOptions.width = options.width;
|
2013-08-08 08:12:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2013-03-15 18:59:47 +04:00
|
|
|
this.element = document.getElementById( options.id );
|
2013-08-08 08:12:44 +04:00
|
|
|
options.controlOptions = {
|
|
|
|
anchor: $.ControlAnchor.NONE,
|
|
|
|
attachToViewer: false,
|
|
|
|
autoFade: false
|
|
|
|
};
|
2013-03-15 18:59:47 +04:00
|
|
|
}
|
|
|
|
this.element.id = options.id;
|
|
|
|
this.element.className += ' navigator';
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2012-03-09 20:04:28 +04:00
|
|
|
options = $.extend( true, {
|
2013-01-31 01:51:37 +04:00
|
|
|
sizeRatio: $.DEFAULT_SETTINGS.navigatorSizeRatio
|
2012-03-09 20:04:28 +04:00
|
|
|
}, options, {
|
2012-03-07 07:20:00 +04:00
|
|
|
element: this.element,
|
|
|
|
//These need to be overridden to prevent recursion since
|
|
|
|
//the navigator is a viewer and a viewer has a navigator
|
|
|
|
showNavigator: false,
|
|
|
|
mouseNavEnabled: false,
|
2012-04-11 01:02:24 +04:00
|
|
|
showNavigationControl: false,
|
2013-03-06 14:51:31 +04:00
|
|
|
showSequenceControl: false,
|
|
|
|
immediateRender: true,
|
|
|
|
blendTime: 0,
|
2013-12-15 02:45:11 +04:00
|
|
|
animationTime: 0,
|
|
|
|
autoResize: options.autoResize
|
2012-03-07 07:20:00 +04:00
|
|
|
});
|
|
|
|
|
2012-09-07 16:55:19 +04:00
|
|
|
options.minPixelRatio = this.minPixelRatio = viewer.minPixelRatio;
|
2012-03-20 03:03:58 +04:00
|
|
|
|
2014-08-06 03:57:54 +04:00
|
|
|
$.setElementTouchActionNone( this.element );
|
2014-08-05 08:41:07 +04:00
|
|
|
|
2013-03-16 06:29:27 +04:00
|
|
|
this.borderWidth = 2;
|
2013-03-24 07:06:34 +04:00
|
|
|
//At some browser magnification levels the display regions lines up correctly, but at some there appears to
|
|
|
|
//be a one pixel gap.
|
|
|
|
this.fudge = new $.Point(1, 1);
|
|
|
|
this.totalBorderWidths = new $.Point(this.borderWidth*2, this.borderWidth*2).minus(this.fudge);
|
|
|
|
|
2013-03-16 06:29:27 +04:00
|
|
|
|
2014-01-14 02:51:22 +04:00
|
|
|
if ( options.controlOptions.anchor != $.ControlAnchor.NONE ) {
|
|
|
|
(function( style, borderWidth ){
|
|
|
|
style.margin = '0px';
|
|
|
|
style.border = borderWidth + 'px solid #555';
|
|
|
|
style.padding = '0px';
|
|
|
|
style.background = '#000';
|
|
|
|
style.opacity = 0.8;
|
|
|
|
style.overflow = 'hidden';
|
|
|
|
}( this.element.style, this.borderWidth));
|
|
|
|
}
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2013-03-16 06:29:27 +04:00
|
|
|
this.displayRegion = $.makeNeutralElement( "div" );
|
2012-03-20 03:03:58 +04:00
|
|
|
this.displayRegion.id = this.element.id + '-displayregion';
|
|
|
|
this.displayRegion.className = 'displayregion';
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2013-03-16 06:29:27 +04:00
|
|
|
(function( style, borderWidth ){
|
2012-03-07 07:20:00 +04:00
|
|
|
style.position = 'relative';
|
|
|
|
style.top = '0px';
|
|
|
|
style.left = '0px';
|
2012-03-21 05:58:23 +04:00
|
|
|
style.fontSize = '0px';
|
2012-09-11 20:31:42 +04:00
|
|
|
style.overflow = 'hidden';
|
2013-03-16 06:29:27 +04:00
|
|
|
style.border = borderWidth + 'px solid #900';
|
|
|
|
style.margin = '0px';
|
|
|
|
style.padding = '0px';
|
2012-03-20 23:00:25 +04:00
|
|
|
//TODO: IE doesnt like this property being set
|
2013-01-24 08:00:11 +04:00
|
|
|
//try{ style.outline = '2px auto #909'; }catch(e){/*ignore*/}
|
2013-06-19 21:33:25 +04:00
|
|
|
|
2012-03-07 07:20:00 +04:00
|
|
|
style.background = 'transparent';
|
2013-01-29 22:06:39 +04:00
|
|
|
|
|
|
|
// We use square bracket notation on the statement below, because float is a keyword.
|
2013-01-31 22:18:32 +04:00
|
|
|
// This is important for the Google Closure compiler, if nothing else.
|
2013-06-19 21:33:25 +04:00
|
|
|
/*jshint sub:true */
|
2013-01-29 22:06:39 +04:00
|
|
|
style['float'] = 'left'; //Webkit
|
2013-06-19 21:33:25 +04:00
|
|
|
|
2012-03-20 10:26:34 +04:00
|
|
|
style.cssFloat = 'left'; //Firefox
|
2012-03-20 23:30:29 +04:00
|
|
|
style.styleFloat = 'left'; //IE
|
2012-03-07 07:20:00 +04:00
|
|
|
style.zIndex = 999999999;
|
2013-12-16 19:17:35 +04:00
|
|
|
style.cursor = 'default';
|
2013-03-16 06:29:27 +04:00
|
|
|
}( this.displayRegion.style, this.borderWidth ));
|
|
|
|
|
2014-08-12 18:27:16 +04:00
|
|
|
this.displayRegionContainer = $.makeNeutralElement("div");
|
|
|
|
this.displayRegionContainer.id = this.element.id + '-displayregioncontainer';
|
|
|
|
this.displayRegionContainer.className = "displayregioncontainer";
|
|
|
|
this.displayRegionContainer.style.width = "100%";
|
|
|
|
this.displayRegionContainer.style.height = "100%";
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2012-04-03 11:08:27 +04:00
|
|
|
this.element.innerTracker = new $.MouseTracker({
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
element: this.element,
|
|
|
|
dragHandler: $.delegate( this, onCanvasDrag ),
|
|
|
|
clickHandler: $.delegate( this, onCanvasClick ),
|
|
|
|
releaseHandler: $.delegate( this, onCanvasRelease ),
|
|
|
|
scrollHandler: $.delegate( this, onCanvasScroll )
|
2012-04-03 11:08:27 +04:00
|
|
|
}).setTracking( true );
|
|
|
|
|
2012-03-20 03:03:58 +04:00
|
|
|
/*this.displayRegion.outerTracker = new $.MouseTracker({
|
2013-06-19 21:33:25 +04:00
|
|
|
element: this.container,
|
|
|
|
clickTimeThreshold: this.clickTimeThreshold,
|
2012-03-20 03:03:58 +04:00
|
|
|
clickDistThreshold: this.clickDistThreshold,
|
|
|
|
enterHandler: $.delegate( this, onContainerEnter ),
|
|
|
|
exitHandler: $.delegate( this, onContainerExit ),
|
|
|
|
releaseHandler: $.delegate( this, onContainerRelease )
|
|
|
|
}).setTracking( this.mouseNavEnabled ? true : false ); // always tracking*/
|
|
|
|
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2013-06-19 21:33:25 +04:00
|
|
|
viewer.addControl(
|
|
|
|
this.element,
|
2013-03-15 18:59:47 +04:00
|
|
|
options.controlOptions
|
2012-03-16 19:36:28 +04:00
|
|
|
);
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2014-01-14 02:51:22 +04:00
|
|
|
if ( options.controlOptions.anchor != $.ControlAnchor.ABSOLUTE && options.controlOptions.anchor != $.ControlAnchor.NONE ) {
|
2013-12-13 23:55:36 +04:00
|
|
|
if ( options.width && options.height ) {
|
|
|
|
this.element.style.height = typeof ( options.height ) == "number" ? ( options.height + 'px' ) : options.height;
|
|
|
|
this.element.style.width = typeof ( options.width ) == "number" ? ( options.width + 'px' ) : options.width;
|
|
|
|
} else {
|
|
|
|
viewerSize = $.getElementSize( viewer.element );
|
2014-04-19 22:48:26 +04:00
|
|
|
this.element.style.height = Math.round( viewerSize.y * options.sizeRatio ) + 'px';
|
|
|
|
this.element.style.width = Math.round( viewerSize.x * options.sizeRatio ) + 'px';
|
2014-01-19 06:19:22 +04:00
|
|
|
this.oldViewerSize = viewerSize;
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
}
|
2014-01-19 06:19:22 +04:00
|
|
|
navigatorSize = $.getElementSize( this.element );
|
|
|
|
this.elementArea = navigatorSize.x * navigatorSize.y;
|
2012-03-07 07:20:00 +04:00
|
|
|
}
|
|
|
|
|
2013-12-15 02:45:11 +04:00
|
|
|
this.oldContainerSize = new $.Point( 0, 0 );
|
|
|
|
|
2013-06-19 21:33:25 +04:00
|
|
|
$.Viewer.apply( this, [ options ] );
|
2012-03-16 19:36:28 +04:00
|
|
|
|
2014-08-12 18:27:16 +04:00
|
|
|
this.displayRegionContainer.appendChild(this.displayRegion);
|
|
|
|
this.element.getElementsByTagName('div')[0].appendChild(this.displayRegionContainer);
|
2013-04-05 06:30:59 +04:00
|
|
|
unneededElement = this.element.getElementsByTagName('textarea')[0];
|
|
|
|
if (unneededElement) {
|
|
|
|
unneededElement.parentNode.removeChild(unneededElement);
|
|
|
|
}
|
2012-08-29 22:46:34 +04:00
|
|
|
|
2014-08-13 13:53:52 +04:00
|
|
|
if (options.navigatorRotate)
|
|
|
|
{
|
|
|
|
options.viewer.addHandler("rotate", function (args) {
|
2014-08-15 12:46:27 +04:00
|
|
|
_setTransformRotate(_this.displayRegionContainer, args.degrees);
|
|
|
|
_setTransformRotate(_this.displayRegion, -args.degrees);
|
2014-08-13 13:53:52 +04:00
|
|
|
_this.viewport.setRotation(args.degrees);
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
2012-03-07 07:20:00 +04:00
|
|
|
};
|
|
|
|
|
2013-11-16 10:19:53 +04:00
|
|
|
$.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /** @lends OpenSeadragon.Navigator.prototype */{
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2012-04-11 01:02:24 +04:00
|
|
|
/**
|
2013-12-15 02:45:11 +04:00
|
|
|
* Used to notify the navigator when its size has changed.
|
|
|
|
* Especially useful when {@link OpenSeadragon.Options}.navigatorAutoResize is set to false and the navigator is resizable.
|
|
|
|
* @function
|
|
|
|
*/
|
|
|
|
updateSize: function () {
|
|
|
|
if ( this.viewport ) {
|
|
|
|
var containerSize = new $.Point(
|
|
|
|
(this.container.clientWidth === 0 ? 1 : this.container.clientWidth),
|
|
|
|
(this.container.clientHeight === 0 ? 1 : this.container.clientHeight)
|
|
|
|
);
|
|
|
|
if ( !containerSize.equals( this.oldContainerSize ) ) {
|
2014-08-20 12:21:02 +04:00
|
|
|
var oldBounds = this.viewport.getBounds();
|
2013-12-15 02:45:11 +04:00
|
|
|
var oldCenter = this.viewport.getCenter();
|
|
|
|
this.viewport.resize( containerSize, true );
|
|
|
|
var imageHeight = 1 / this.source.aspectRatio;
|
|
|
|
var newWidth = oldBounds.width <= 1 ? oldBounds.width : 1;
|
|
|
|
var newHeight = oldBounds.height <= imageHeight ?
|
|
|
|
oldBounds.height : imageHeight;
|
|
|
|
var newBounds = new $.Rect(
|
|
|
|
oldCenter.x - ( newWidth / 2.0 ),
|
|
|
|
oldCenter.y - ( newHeight / 2.0 ),
|
|
|
|
newWidth,
|
|
|
|
newHeight
|
|
|
|
);
|
|
|
|
this.viewport.fitBounds( newBounds, true );
|
|
|
|
this.oldContainerSize = containerSize;
|
|
|
|
this.drawer.update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used to update the navigator minimap's viewport rectangle when a change in the viewer's viewport occurs.
|
2012-04-11 01:02:24 +04:00
|
|
|
* @function
|
2013-12-15 02:45:11 +04:00
|
|
|
* @param {OpenSeadragon.Viewport} The viewport this navigator is tracking.
|
2012-04-11 01:02:24 +04:00
|
|
|
*/
|
2013-12-15 02:45:11 +04:00
|
|
|
update: function( viewport ) {
|
2012-03-07 07:20:00 +04:00
|
|
|
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
var viewerSize,
|
2014-01-19 06:19:22 +04:00
|
|
|
newWidth,
|
|
|
|
newHeight,
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
bounds,
|
2012-04-03 11:08:27 +04:00
|
|
|
topleft,
|
|
|
|
bottomright;
|
|
|
|
|
2014-01-19 06:19:22 +04:00
|
|
|
viewerSize = $.getElementSize( this.viewer.element );
|
|
|
|
if ( !viewerSize.equals( this.oldViewerSize ) ) {
|
|
|
|
this.oldViewerSize = viewerSize;
|
|
|
|
if ( this.maintainSizeRatio ) {
|
|
|
|
newWidth = viewerSize.x * this.sizeRatio;
|
|
|
|
newHeight = viewerSize.y * this.sizeRatio;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
newWidth = Math.sqrt(this.elementArea * (viewerSize.x / viewerSize.y));
|
|
|
|
newHeight = this.elementArea / newWidth;
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
}
|
2014-04-19 22:48:26 +04:00
|
|
|
this.element.style.width = Math.round( newWidth ) + 'px';
|
|
|
|
this.element.style.height = Math.round( newHeight ) + 'px';
|
2014-01-19 06:19:22 +04:00
|
|
|
this.updateSize();
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
}
|
|
|
|
|
2013-12-15 02:45:11 +04:00
|
|
|
if( viewport && this.viewport ) {
|
2012-04-03 11:08:27 +04:00
|
|
|
bounds = viewport.getBounds( true );
|
2013-12-15 02:45:11 +04:00
|
|
|
topleft = this.viewport.pixelFromPoint( bounds.getTopLeft(), false );
|
|
|
|
bottomright = this.viewport.pixelFromPoint( bounds.getBottomRight(), false ).minus( this.totalBorderWidths );
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2013-06-19 21:33:25 +04:00
|
|
|
//update style for navigator-box
|
2013-06-19 01:55:19 +04:00
|
|
|
(function(style) {
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2014-04-19 22:48:26 +04:00
|
|
|
style.top = Math.round( topleft.y ) + 'px';
|
|
|
|
style.left = Math.round( topleft.x ) + 'px';
|
2013-01-28 22:11:14 +04:00
|
|
|
|
2013-03-24 05:11:30 +04:00
|
|
|
var width = Math.abs( topleft.x - bottomright.x );
|
|
|
|
var height = Math.abs( topleft.y - bottomright.y );
|
2013-01-25 17:17:35 +04:00
|
|
|
// make sure width and height are non-negative so IE doesn't throw
|
2014-04-19 22:48:26 +04:00
|
|
|
style.width = Math.round( Math.max( width, 0 ) ) + 'px';
|
|
|
|
style.height = Math.round( Math.max( height, 0 ) ) + 'px';
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2013-06-19 23:15:26 +04:00
|
|
|
}( this.displayRegion.style ));
|
2013-06-19 21:33:25 +04:00
|
|
|
}
|
2012-03-07 07:20:00 +04:00
|
|
|
|
2013-03-06 14:51:31 +04:00
|
|
|
},
|
|
|
|
|
2013-12-15 02:45:11 +04:00
|
|
|
open: function( source ) {
|
|
|
|
this.updateSize();
|
2013-03-06 14:51:31 +04:00
|
|
|
var containerSize = this.viewer.viewport.containerSize.times( this.sizeRatio );
|
2014-07-28 23:17:45 +04:00
|
|
|
var ts = source.getTileSize(source.maxLevel);
|
|
|
|
if ( ts > containerSize.x || ts > containerSize.y ) {
|
|
|
|
this.minPixelRatio = Math.min( containerSize.x, containerSize.y ) / ts;
|
2013-03-06 14:51:31 +04:00
|
|
|
} else {
|
2013-03-26 17:02:34 +04:00
|
|
|
this.minPixelRatio = this.viewer.minPixelRatio;
|
2013-03-06 14:51:31 +04:00
|
|
|
}
|
|
|
|
return $.Viewer.prototype.open.apply( this, [ source ] );
|
2012-03-07 07:20:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2012-04-11 01:02:24 +04:00
|
|
|
/**
|
|
|
|
* @private
|
|
|
|
* @inner
|
|
|
|
* @function
|
|
|
|
*/
|
2013-10-11 04:00:15 +04:00
|
|
|
function onCanvasClick( event ) {
|
2014-08-06 00:56:18 +04:00
|
|
|
if ( event.quick && this.viewer.viewport ) {
|
2014-08-12 18:27:16 +04:00
|
|
|
this.viewer.viewport.panTo( this.viewport.pointFromPixel( event.position ).rotate( -this.viewer.viewport.degrees, this.viewer.viewport.getHomeBounds().getCenter() ) );
|
2014-08-06 00:56:18 +04:00
|
|
|
this.viewer.viewport.applyConstraints();
|
2013-03-16 06:29:27 +04:00
|
|
|
}
|
2013-01-29 21:32:58 +04:00
|
|
|
}
|
2012-04-03 11:08:27 +04:00
|
|
|
|
2012-04-11 01:02:24 +04:00
|
|
|
/**
|
|
|
|
* @private
|
|
|
|
* @inner
|
|
|
|
* @function
|
|
|
|
*/
|
2013-10-11 04:00:15 +04:00
|
|
|
function onCanvasDrag( event ) {
|
2012-04-03 11:08:27 +04:00
|
|
|
if ( this.viewer.viewport ) {
|
|
|
|
if( !this.panHorizontal ){
|
2013-10-11 04:00:15 +04:00
|
|
|
event.delta.x = 0;
|
2012-04-03 11:08:27 +04:00
|
|
|
}
|
|
|
|
if( !this.panVertical ){
|
2013-10-11 04:00:15 +04:00
|
|
|
event.delta.y = 0;
|
2012-04-03 11:08:27 +04:00
|
|
|
}
|
2013-06-19 21:33:25 +04:00
|
|
|
this.viewer.viewport.panBy(
|
|
|
|
this.viewport.deltaPointsFromPixels(
|
2013-10-11 04:00:15 +04:00
|
|
|
event.delta
|
2013-06-19 21:33:25 +04:00
|
|
|
)
|
2012-04-03 11:08:27 +04:00
|
|
|
);
|
|
|
|
}
|
2013-01-29 21:32:58 +04:00
|
|
|
}
|
2012-04-03 11:08:27 +04:00
|
|
|
|
|
|
|
|
2012-04-11 01:02:24 +04:00
|
|
|
/**
|
|
|
|
* @private
|
|
|
|
* @inner
|
|
|
|
* @function
|
|
|
|
*/
|
2013-10-11 04:00:15 +04:00
|
|
|
function onCanvasRelease( event ) {
|
|
|
|
if ( event.insideElementPressed && this.viewer.viewport ) {
|
2012-04-03 11:08:27 +04:00
|
|
|
this.viewer.viewport.applyConstraints();
|
|
|
|
}
|
2013-01-29 21:32:58 +04:00
|
|
|
}
|
2012-04-03 11:08:27 +04:00
|
|
|
|
2012-04-11 01:02:24 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @private
|
|
|
|
* @inner
|
|
|
|
* @function
|
|
|
|
*/
|
2013-10-11 04:00:15 +04:00
|
|
|
function onCanvasScroll( event ) {
|
Enhanced Navigator Resizability (#280, #296)
New navigator options:
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio,
navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options
will be ignored.
* If an ID is not specified, a div element will be generated and
placed on top of the main image.
*
* @property {String} [navigatorPosition='TOP_RIGHT']
* Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT',
'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>
* If 'ABSOLUTE' is specified, then navigatorTop|Left|Height|Width
determines the size and position of the navigator minimap in the viewer,
and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>
* For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT',
the navigatorSizeRatio or navigatorHeight|Width values determine the
size of the navigator minimap.
*
* @property {Number} [navigatorSizeRatio=0.2]
* Ratio of navigator size to viewer size. Ignored if
navigatorHeight|Width are specified.
*
* @property {Boolean} [navigatorMaintainSizeRatio=false]
* If true, the navigator minimap is resized (using
navigatorSizeRatio) when the viewer size changes.
*
* @property {Number|String} [navigatorTop=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorLeft=null]
* Specifies the location of the navigator minimap (see
navigatorPosition).
*
* @property {Number|String} [navigatorHeight=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
*
* @property {Number|String} [navigatorWidth=null]
* Specifies the size of the navigator minimap (see
navigatorPosition).
* If specified, navigatorSizeRatio and navigatorMaintainSizeRatio
are ignored.
Fixes #280 and #296
2013-12-13 21:23:56 +04:00
|
|
|
/**
|
|
|
|
* Raised when a scroll event occurs on the {@link OpenSeadragon.Viewer#navigator} element (mouse wheel, touch pinch, etc.).
|
|
|
|
*
|
|
|
|
* @event navigator-scroll
|
|
|
|
* @memberof OpenSeadragon.Viewer
|
|
|
|
* @type {object}
|
|
|
|
* @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.
|
|
|
|
* @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.
|
|
|
|
* @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.
|
|
|
|
* @property {Number} scroll - The scroll delta for the event.
|
|
|
|
* @property {Boolean} shift - True if the shift key was pressed during this event.
|
|
|
|
* @property {Object} originalEvent - The original DOM event.
|
|
|
|
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
|
|
|
*/
|
|
|
|
this.viewer.raiseEvent( 'navigator-scroll', {
|
|
|
|
tracker: event.eventSource,
|
|
|
|
position: event.position,
|
|
|
|
scroll: event.scroll,
|
|
|
|
shift: event.shift,
|
|
|
|
originalEvent: event.originalEvent
|
|
|
|
});
|
|
|
|
|
|
|
|
//dont scroll the page up and down if the user is scrolling
|
|
|
|
//in the navigator
|
2012-04-03 11:08:27 +04:00
|
|
|
return false;
|
2013-01-29 21:32:58 +04:00
|
|
|
}
|
2012-04-03 11:08:27 +04:00
|
|
|
|
2014-08-13 13:53:52 +04:00
|
|
|
/**
|
|
|
|
* @function
|
|
|
|
* @private
|
|
|
|
* @param {Object} element
|
|
|
|
* @param {Number} degrees
|
|
|
|
*/
|
|
|
|
function _setTransformRotate (element, degrees) {
|
|
|
|
element.style.webkitTransform = "rotate(" + degrees + "deg)";
|
|
|
|
element.style.mozTransform = "rotate(" + degrees + "deg)";
|
|
|
|
element.style.msTransform = "rotate(" + degrees + "deg)";
|
|
|
|
element.style.oTransform = "rotate(" + degrees + "deg)";
|
|
|
|
element.style.transform = "rotate(" + degrees + "deg)";
|
|
|
|
}
|
2012-04-03 11:08:27 +04:00
|
|
|
|
2013-01-25 17:17:35 +04:00
|
|
|
}( OpenSeadragon ));
|