removed global variable SIGNAL. moved it into OpenSeadragon namespace

This commit is contained in:
thatcher 2011-12-06 07:21:30 -05:00
parent 916ada5f02
commit b871f6c2bf
5 changed files with 7 additions and 23 deletions

View File

@ -42,13 +42,9 @@
OpenSeadragon = window.OpenSeadragon || function(){}; OpenSeadragon = window.OpenSeadragon || function(){};
//TODO: remove this hack
if (!window.SIGNAL){
window.SIGNAL = "----seadragon----";
}
(function( $ ){ (function( $ ){
$.SIGNAL = "----seadragon----";
$.delegate = function(object, method) { $.delegate = function(object, method) {
return function() { return function() {
@ -58,7 +54,6 @@ if (!window.SIGNAL){
}; };
}; };
$.format = function(){ $.format = function(){
var args = arguments, var args = arguments,
@ -1255,7 +1250,7 @@ $.NavControl.prototype = {
}); });
this.elmt = this._group.get_element(); this.elmt = this._group.get_element();
this.elmt[SIGNAL] = true; // hack to get our controls to fade this.elmt[$.SIGNAL] = true; // hack to get our controls to fade
this._viewer.add_open($.delegate(this, this._lightUp)); this._viewer.add_open($.delegate(this, this._lightUp));
}, },
@ -1367,7 +1362,7 @@ $.Control.prototype = {
this.wrapper.style.display = visible ? "inline-block" : "none"; this.wrapper.style.display = visible ? "inline-block" : "none";
}, },
setOpacity: function(opacity) { setOpacity: function(opacity) {
if (this.elmt[SIGNAL] && $.Utils.getBrowser() == $.Browser.IE) { if (this.elmt[$.SIGNAL] && $.Utils.getBrowser() == $.Browser.IE) {
$.Utils.setElementOpacity(this.elmt, opacity, true); $.Utils.setElementOpacity(this.elmt, opacity, true);
} else { } else {
$.Utils.setElementOpacity(this.wrapper, opacity, true); $.Utils.setElementOpacity(this.wrapper, opacity, true);

View File

@ -1,6 +0,0 @@
(function( $ ){
}( OpenSeadragon ));

View File

@ -32,7 +32,7 @@ $.Control.prototype = {
this.wrapper.style.display = visible ? "inline-block" : "none"; this.wrapper.style.display = visible ? "inline-block" : "none";
}, },
setOpacity: function(opacity) { setOpacity: function(opacity) {
if (this.elmt[SIGNAL] && $.Utils.getBrowser() == $.Browser.IE) { if (this.elmt[$.SIGNAL] && $.Utils.getBrowser() == $.Browser.IE) {
$.Utils.setElementOpacity(this.elmt, opacity, true); $.Utils.setElementOpacity(this.elmt, opacity, true);
} else { } else {
$.Utils.setElementOpacity(this.wrapper, opacity, true); $.Utils.setElementOpacity(this.wrapper, opacity, true);

View File

@ -79,7 +79,7 @@ $.NavControl.prototype = {
}); });
this.elmt = this._group.get_element(); this.elmt = this._group.get_element();
this.elmt[SIGNAL] = true; // hack to get our controls to fade this.elmt[$.SIGNAL] = true; // hack to get our controls to fade
this._viewer.add_open($.delegate(this, this._lightUp)); this._viewer.add_open($.delegate(this, this._lightUp));
}, },

View File

@ -40,15 +40,11 @@
* *
**/ **/
OpenSeadragon = window.OpenSeadragon || function(){}; OpenSeadragon = window.OpenSeadragon || function(){};
//TODO: remove this hack
if (!window.SIGNAL){
window.SIGNAL = "----seadragon----";
}
(function( $ ){ (function( $ ){
$.SIGNAL = "----seadragon----";
$.delegate = function(object, method) { $.delegate = function(object, method) {
return function() { return function() {
@ -58,7 +54,6 @@ if (!window.SIGNAL){
}; };
}; };
$.format = function(){ $.format = function(){
var args = arguments, var args = arguments,