Navigator update

Allow navigators hosted in a user-supplied element to be styled by user.
This commit is contained in:
Mark Salsbery 2014-01-13 14:51:22 -08:00
parent 23954d0adf
commit 7ce552caf9

View File

@ -118,14 +118,16 @@ $.Navigator = function( options ){
this.totalBorderWidths = new $.Point(this.borderWidth*2, this.borderWidth*2).minus(this.fudge); this.totalBorderWidths = new $.Point(this.borderWidth*2, this.borderWidth*2).minus(this.fudge);
(function( style, borderWidth ){ if ( options.controlOptions.anchor != $.ControlAnchor.NONE ) {
style.margin = '0px'; (function( style, borderWidth ){
style.border = borderWidth + 'px solid #555'; style.margin = '0px';
style.padding = '0px'; style.border = borderWidth + 'px solid #555';
style.background = '#000'; style.padding = '0px';
style.opacity = 0.8; style.background = '#000';
style.overflow = 'hidden'; style.opacity = 0.8;
}( this.element.style, this.borderWidth)); style.overflow = 'hidden';
}( this.element.style, this.borderWidth));
}
this.displayRegion = $.makeNeutralElement( "div" ); this.displayRegion = $.makeNeutralElement( "div" );
this.displayRegion.id = this.element.id + '-displayregion'; this.displayRegion.id = this.element.id + '-displayregion';
@ -180,7 +182,7 @@ $.Navigator = function( options ){
options.controlOptions options.controlOptions
); );
if ( options.controlOptions.anchor != $.ControlAnchor.ABSOLUTE ) { if ( options.controlOptions.anchor != $.ControlAnchor.ABSOLUTE && options.controlOptions.anchor != $.ControlAnchor.NONE ) {
if ( options.width && options.height ) { if ( options.width && options.height ) {
this.element.style.height = typeof ( options.height ) == "number" ? ( options.height + 'px' ) : 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; this.element.style.width = typeof ( options.width ) == "number" ? ( options.width + 'px' ) : options.width;