From 6b6b7f7625b7787cd9b1a14c1c3e81cbb3a36a0a Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Fri, 6 Dec 2013 22:48:49 -0800 Subject: [PATCH 1/2] Added ControlAnchor options for default controls --- src/openseadragon.js | 20 ++++++++++++++------ src/viewer.js | 4 ++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index 5b1da3c3..40af70aa 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -264,6 +264,9 @@ * @property {Boolean} [showNavigationControl=true] * Set to false to prevent the appearance of the default navigation controls. * + * @property {OpenSeadragon.ControlAnchor} [navigationControlAnchor=TOP_LEFT] + * Placement of the default navigation controls. + * * @property {Boolean} [showNavigator=false] * Set to true to make the navigator minimap appear. * @@ -319,6 +322,9 @@ * If the viewer has been configured with a sequence of tile sources, then * provide buttons for navigating forward and backward through the images. * + * @property {OpenSeadragon.ControlAnchor} [sequenceControlAnchor=TOP_LEFT] + * Placement of the default sequence controls. + * * @property {Number} [initialPage=0] * If the viewer has been configured with a sequence of tile sources, display this page initially. * @@ -697,12 +703,14 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ autoResize: true, //DEFAULT CONTROL SETTINGS - showSequenceControl: true, //SEQUENCE - preserveViewport: false, //SEQUENCE - showNavigationControl: true, //ZOOM/HOME/FULL/SEQUENCE - controlsFadeDelay: 2000, //ZOOM/HOME/FULL/SEQUENCE - controlsFadeLength: 1500, //ZOOM/HOME/FULL/SEQUENCE - mouseNavEnabled: true, //GENERAL MOUSE INTERACTIVITY + showSequenceControl: true, //SEQUENCE + sequenceControlAnchor: null, //SEQUENCE + preserveViewport: false, //SEQUENCE + showNavigationControl: true, //ZOOM/HOME/FULL/SEQUENCE + navigationControlAnchor: null, //ZOOM/HOME/FULL + controlsFadeDelay: 2000, //ZOOM/HOME/FULL/SEQUENCE + controlsFadeLength: 1500, //ZOOM/HOME/FULL/SEQUENCE + mouseNavEnabled: true, //GENERAL MOUSE INTERACTIVITY //VIEWPORT NAVIGATOR SETTINGS showNavigator: false, diff --git a/src/viewer.js b/src/viewer.js index 7d9e755b..051a7b7e 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1122,7 +1122,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, }else{ this.addControl( this.pagingControl, - {anchor: $.ControlAnchor.TOP_LEFT} + {anchor: this.sequenceControlAnchor ? this.sequenceControlAnchor : $.ControlAnchor.TOP_LEFT} ); } } @@ -1243,7 +1243,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, }else{ this.addControl( this.navControl, - {anchor: $.ControlAnchor.TOP_LEFT} + {anchor: this.navigationControlAnchor ? this.navigationControlAnchor : $.ControlAnchor.TOP_LEFT} ); } } From babfb99be9295b0e4c9e1d78c81df1b0f99f964a Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Mon, 9 Dec 2013 10:04:39 -0800 Subject: [PATCH 2/2] Code fix --- src/viewer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index 051a7b7e..8894a8a4 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1122,7 +1122,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, }else{ this.addControl( this.pagingControl, - {anchor: this.sequenceControlAnchor ? this.sequenceControlAnchor : $.ControlAnchor.TOP_LEFT} + {anchor: this.sequenceControlAnchor || $.ControlAnchor.TOP_LEFT} ); } } @@ -1243,7 +1243,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, }else{ this.addControl( this.navControl, - {anchor: this.navigationControlAnchor ? this.navigationControlAnchor : $.ControlAnchor.TOP_LEFT} + {anchor: this.navigationControlAnchor || $.ControlAnchor.TOP_LEFT} ); } }