From d4dfcd2288be9147c8c5e44f8e26fe4615d6ef9e Mon Sep 17 00:00:00 2001 From: Joe DF <3848219+joedf@users.noreply.github.com> Date: Sun, 29 May 2022 20:53:11 -0400 Subject: [PATCH] fix inconsistent open-close braces, add warn when using element even when id provided --- src/navigator.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/navigator.js b/src/navigator.js index 954ec8d0..f64a1d0a 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -57,14 +57,16 @@ $.Navigator = function( options ){ //We may need to create a new element and id if they did not //provide the id for the existing element or the element itself if( !options.element ){ - if( !options.id ){ - options.id = 'navigator-' + $.now(); - this.element = $.makeNeutralElement( "div" ); - options.controlOptions = { - anchor: $.ControlAnchor.TOP_RIGHT, - attachToViewer: true, - autoFade: options.autoFade - }; + if (!options.id) { + options.id = 'navigator-' + $.now(); + } + + this.element = $.makeNeutralElement( "div" ); + options.controlOptions = { + anchor: $.ControlAnchor.TOP_RIGHT, + attachToViewer: true, + autoFade: options.autoFade + }; if( options.position ){ if( 'BOTTOM_RIGHT' === options.position ){ @@ -94,6 +96,8 @@ $.Navigator = function( options ){ this.element.id = options.id; } else { this.element = options.element; + $.console.warn("Given option.id for Navigator was ignored since option.element was provided and is being used instead."); + options.controlOptions = { anchor: $.ControlAnchor.NONE, attachToViewer: false,