moved only relevant object literal from controlanchor.js into control.js, deleted controlanchor.js and removed it from the build

This commit is contained in:
thatcher 2011-12-13 17:57:40 -05:00
parent c9034f3f96
commit c35ee2bca9
4 changed files with 26 additions and 45 deletions

View File

@ -23,7 +23,6 @@
<file name="src/eventhandlerlist.js" />
<file name="src/utils.js" />
<file name="src/mousetracker.js" />
<file name="src/controlanchor.js" />
<file name="src/navcontrol.js" />
<file name="src/control.js" />
<file name="src/viewer.js" />

View File

@ -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);

View File

@ -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);

View File

@ -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 ));