mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 22:56:11 +03:00
Navigator update
Allow navigators hosted in a user-supplied element to be styled by user.
This commit is contained in:
parent
23954d0adf
commit
7ce552caf9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user