mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Merge pull request #2175 from joedf/patch-2174
added navigatorElement, fix bug id-overwrite on element
This commit is contained in:
commit
0114381ebe
@ -62,14 +62,14 @@ $.Navigator = function( options ){
|
|||||||
if ( options.element ) {
|
if ( options.element ) {
|
||||||
if ( options.id ){
|
if ( options.id ){
|
||||||
$.console.warn("Given option.id for Navigator was ignored since option.element was provided and is being used instead.");
|
$.console.warn("Given option.id for Navigator was ignored since option.element was provided and is being used instead.");
|
||||||
} else {
|
}
|
||||||
|
|
||||||
// Don't overwrite the element's id if it has one already
|
// Don't overwrite the element's id if it has one already
|
||||||
if ( options.element.id ) {
|
if ( options.element.id ) {
|
||||||
options.id = options.element.id;
|
options.id = options.element.id;
|
||||||
} else {
|
} else {
|
||||||
options.id = 'navigator-' + $.now();
|
options.id = 'navigator-' + $.now();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.element = options.element;
|
this.element = options.element;
|
||||||
} else {
|
} else {
|
||||||
|
@ -410,6 +410,11 @@
|
|||||||
* @property {Boolean} [showNavigator=false]
|
* @property {Boolean} [showNavigator=false]
|
||||||
* Set to true to make the navigator minimap appear.
|
* Set to true to make the navigator minimap appear.
|
||||||
*
|
*
|
||||||
|
* @property {Element} [navigatorElement=null]
|
||||||
|
* The element to hold the navigator minimap.
|
||||||
|
* If an element is specified, the Id option (see navigatorId) is ignored.
|
||||||
|
* If no element nor ID is specified, a div element will be generated accordingly.
|
||||||
|
*
|
||||||
* @property {String} [navigatorId=navigator-GENERATED DATE]
|
* @property {String} [navigatorId=navigator-GENERATED DATE]
|
||||||
* The ID of a div to hold the navigator minimap.
|
* The ID of a div to hold the navigator minimap.
|
||||||
* If an ID is specified, the navigatorPosition, navigatorSizeRatio, navigatorMaintainSizeRatio, navigator[Top|Left|Height|Width] and navigatorAutoFade options will be ignored.
|
* If an ID is specified, the navigatorPosition, navigatorSizeRatio, navigatorMaintainSizeRatio, navigator[Top|Left|Height|Width] and navigatorAutoFade options will be ignored.
|
||||||
@ -1265,6 +1270,7 @@ function OpenSeadragon( options ){
|
|||||||
|
|
||||||
//VIEWPORT NAVIGATOR SETTINGS
|
//VIEWPORT NAVIGATOR SETTINGS
|
||||||
showNavigator: false,
|
showNavigator: false,
|
||||||
|
navigatorElement: null,
|
||||||
navigatorId: null,
|
navigatorId: null,
|
||||||
navigatorPosition: null,
|
navigatorPosition: null,
|
||||||
navigatorSizeRatio: 0.2,
|
navigatorSizeRatio: 0.2,
|
||||||
|
@ -431,6 +431,7 @@ $.Viewer = function( options ) {
|
|||||||
//Instantiate a navigator if configured
|
//Instantiate a navigator if configured
|
||||||
if ( this.showNavigator){
|
if ( this.showNavigator){
|
||||||
this.navigator = new $.Navigator({
|
this.navigator = new $.Navigator({
|
||||||
|
element: this.navigatorElement,
|
||||||
id: this.navigatorId,
|
id: this.navigatorId,
|
||||||
position: this.navigatorPosition,
|
position: this.navigatorPosition,
|
||||||
sizeRatio: this.navigatorSizeRatio,
|
sizeRatio: this.navigatorSizeRatio,
|
||||||
|
Loading…
Reference in New Issue
Block a user