diff --git a/build.xml b/build.xml index c20515d2..fc870825 100644 --- a/build.xml +++ b/build.xml @@ -23,7 +23,6 @@ - diff --git a/openseadragon.js b/openseadragon.js index e2afb5ea..3ed8e8f5 100644 --- a/openseadragon.js +++ b/openseadragon.js @@ -1198,26 +1198,6 @@ $.Utils = new $.Utils(); }( OpenSeadragon )); -(function( $ ){ - - - $.ControlAnchor = function() { - throw Error.invalidOperation(); - }; - - $.ControlAnchor = { - NONE: 0, - TOP_LEFT: 1, - TOP_RIGHT: 2, - BOTTOM_RIGHT: 3, - BOTTOM_LEFT: 4 - }; - - $.ControlAnchor = $.ControlAnchor; - -}( OpenSeadragon )); - - (function( $ ){ $.NavControl = function(viewer) { @@ -1381,6 +1361,14 @@ $.NavControl.prototype = { (function( $ ){ +$.ControlAnchor = { + NONE: 0, + TOP_LEFT: 1, + TOP_RIGHT: 2, + BOTTOM_RIGHT: 3, + BOTTOM_LEFT: 4 +}; + $.Control = function (elmt, anchor, container) { this.elmt = elmt; this.anchor = anchor; @@ -1388,11 +1376,14 @@ $.Control = function (elmt, anchor, container) { this.wrapper = $.Utils.makeNeutralElement("span"); this.wrapper.style.display = "inline-block"; this.wrapper.appendChild(this.elmt); + if (this.anchor == $.ControlAnchor.NONE) { - this.wrapper.style.width = this.wrapper.style.height = "100%"; // IE6 fix + // IE6 fix + this.wrapper.style.width = this.wrapper.style.height = "100%"; } - if (this.anchor == $.ControlAnchor.TOP_RIGHT || this.anchor == $.ControlAnchor.BOTTOM_RIGHT) { + if ( this.anchor == $.ControlAnchor.TOP_RIGHT || + this.anchor == $.ControlAnchor.BOTTOM_RIGHT ) { this.container.insertBefore(this.wrapper, this.container.firstChild); } else { this.container.appendChild(this.wrapper); diff --git a/src/control.js b/src/control.js index b765a387..cb348787 100644 --- a/src/control.js +++ b/src/control.js @@ -2,6 +2,14 @@ (function( $ ){ +$.ControlAnchor = { + NONE: 0, + TOP_LEFT: 1, + TOP_RIGHT: 2, + BOTTOM_RIGHT: 3, + BOTTOM_LEFT: 4 +}; + $.Control = function (elmt, anchor, container) { this.elmt = elmt; this.anchor = anchor; @@ -9,11 +17,14 @@ $.Control = function (elmt, anchor, container) { this.wrapper = $.Utils.makeNeutralElement("span"); this.wrapper.style.display = "inline-block"; this.wrapper.appendChild(this.elmt); + if (this.anchor == $.ControlAnchor.NONE) { - this.wrapper.style.width = this.wrapper.style.height = "100%"; // IE6 fix + // IE6 fix + this.wrapper.style.width = this.wrapper.style.height = "100%"; } - if (this.anchor == $.ControlAnchor.TOP_RIGHT || this.anchor == $.ControlAnchor.BOTTOM_RIGHT) { + if ( this.anchor == $.ControlAnchor.TOP_RIGHT || + this.anchor == $.ControlAnchor.BOTTOM_RIGHT ) { this.container.insertBefore(this.wrapper, this.container.firstChild); } else { this.container.appendChild(this.wrapper); diff --git a/src/controlanchor.js b/src/controlanchor.js deleted file mode 100644 index 6433405e..00000000 --- a/src/controlanchor.js +++ /dev/null @@ -1,20 +0,0 @@ - -(function( $ ){ - - - $.ControlAnchor = function() { - throw Error.invalidOperation(); - }; - - $.ControlAnchor = { - NONE: 0, - TOP_LEFT: 1, - TOP_RIGHT: 2, - BOTTOM_RIGHT: 3, - BOTTOM_LEFT: 4 - }; - - $.ControlAnchor = $.ControlAnchor; - -}( OpenSeadragon )); -