From 7ce552caf9c069eddb18bd0165a73a87cf2098f2 Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Mon, 13 Jan 2014 14:51:22 -0800 Subject: [PATCH] Navigator update Allow navigators hosted in a user-supplied element to be styled by user. --- src/navigator.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/navigator.js b/src/navigator.js index 687a8b10..a7ae7384 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -118,14 +118,16 @@ $.Navigator = function( options ){ this.totalBorderWidths = new $.Point(this.borderWidth*2, this.borderWidth*2).minus(this.fudge); - (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)); + 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)); + } this.displayRegion = $.makeNeutralElement( "div" ); this.displayRegion.id = this.element.id + '-displayregion'; @@ -180,7 +182,7 @@ $.Navigator = function( options ){ options.controlOptions ); - if ( options.controlOptions.anchor != $.ControlAnchor.ABSOLUTE ) { + if ( options.controlOptions.anchor != $.ControlAnchor.ABSOLUTE && options.controlOptions.anchor != $.ControlAnchor.NONE ) { 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;