From 88141c57f2c04e7914e40de47a297a7b456d5e99 Mon Sep 17 00:00:00 2001 From: thatcher Date: Thu, 8 Aug 2013 00:12:44 -0400 Subject: [PATCH] feature: navigatorPosition, option was available but not completely implemented --- src/navigator.js | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/navigator.js b/src/navigator.js index a956d245..cd64f953 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -58,15 +58,31 @@ $.Navigator = function( options ){ if( !options.id ){ options.id = 'navigator-' + $.now(); this.element = $.makeNeutralElement( "div" ); - options.controlOptions = {anchor: $.ControlAnchor.TOP_RIGHT, - attachToViewer: true, - autoFade: true}; - } - else { + 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; + } + } + + } else { this.element = document.getElementById( options.id ); - options.controlOptions = {anchor: $.ControlAnchor.NONE, - attachToViewer: false, - autoFade: false}; + options.controlOptions = { + anchor: $.ControlAnchor.NONE, + attachToViewer: false, + autoFade: false + }; } this.element.id = options.id; this.element.className += ' navigator';