mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-18 07:43:13 +03:00
found some lingering references to 'this' in private closure methods.
This commit is contained in:
parent
345e5f3e6c
commit
114a26b1a9
@ -222,20 +222,26 @@ OpenSeadragon = window.OpenSeadragon || (function(){
|
|||||||
//Start Thatcher - unneccessary indirection. Also, because events were
|
//Start Thatcher - unneccessary indirection. Also, because events were
|
||||||
// - not actually being removed, we need to add the code
|
// - not actually being removed, we need to add the code
|
||||||
// - to do the removal ourselves. TODO
|
// - to do the removal ourselves. TODO
|
||||||
var evt = this.events[ id ];
|
var events = this.events[ id ];
|
||||||
if (!evt) return;
|
if ( !events ){
|
||||||
|
return;
|
||||||
|
}
|
||||||
//End Thatcher
|
//End Thatcher
|
||||||
},
|
},
|
||||||
|
|
||||||
getHandler: function( id ) {
|
getHandler: function( id ) {
|
||||||
var evt = this.events[ id ];
|
var events = this.events[ id ];
|
||||||
if (!evt || !evt.length) return null;
|
if ( !events || !events.length ){
|
||||||
evt = evt.length === 1 ?
|
return null;
|
||||||
[evt[0]] :
|
}
|
||||||
Array.apply( null, evt );
|
events = events.length === 1 ?
|
||||||
|
[ events[ 0 ] ] :
|
||||||
|
Array.apply( null, events );
|
||||||
return function( source, args ) {
|
return function( source, args ) {
|
||||||
for (var i = 0, l = evt.length; i < l; i++) {
|
var i,
|
||||||
evt[i](source, args);
|
l = events.length;
|
||||||
|
for ( i = 0; i < l; i++ ) {
|
||||||
|
events[ i ]( source, args );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -2873,12 +2879,12 @@ $.Button = function( options ) {
|
|||||||
},
|
},
|
||||||
pressHandler: function(tracker, position) {
|
pressHandler: function(tracker, position) {
|
||||||
inTo( _this, $.ButtonState.DOWN );
|
inTo( _this, $.ButtonState.DOWN );
|
||||||
this.raiseEvent( "onPress", _this );
|
_this.raiseEvent( "onPress", _this );
|
||||||
},
|
},
|
||||||
releaseHandler: function(tracker, position, insideElmtPress, insideElmtRelease) {
|
releaseHandler: function(tracker, position, insideElmtPress, insideElmtRelease) {
|
||||||
if ( insideElmtPress && insideElmtRelease ) {
|
if ( insideElmtPress && insideElmtRelease ) {
|
||||||
outTo( _this, $.ButtonState.HOVER );
|
outTo( _this, $.ButtonState.HOVER );
|
||||||
this.raiseEvent( "onRelease", _this );
|
_this.raiseEvent( "onRelease", _this );
|
||||||
} else if ( insideElmtPress ) {
|
} else if ( insideElmtPress ) {
|
||||||
outTo( _this, $.ButtonState.GROUP );
|
outTo( _this, $.ButtonState.GROUP );
|
||||||
} else {
|
} else {
|
||||||
@ -2970,8 +2976,8 @@ function outTo( button, newState ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( newState <= $.ButtonState.GROUP && button.currentState == $.ButtonState.HOVER ) {
|
if ( newState <= $.ButtonState.GROUP && button.currentState == $.ButtonState.HOVER ) {
|
||||||
this.imgHover.style.visibility = "hidden";
|
button.imgHover.style.visibility = "hidden";
|
||||||
this.currentState = $.ButtonState.GROUP;
|
button.currentState = $.ButtonState.GROUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( button.newState <= $.ButtonState.REST && button.currentState == $.ButtonState.GROUP ) {
|
if ( button.newState <= $.ButtonState.REST && button.currentState == $.ButtonState.GROUP ) {
|
||||||
|
@ -116,12 +116,12 @@ $.Button = function( options ) {
|
|||||||
},
|
},
|
||||||
pressHandler: function(tracker, position) {
|
pressHandler: function(tracker, position) {
|
||||||
inTo( _this, $.ButtonState.DOWN );
|
inTo( _this, $.ButtonState.DOWN );
|
||||||
this.raiseEvent( "onPress", _this );
|
_this.raiseEvent( "onPress", _this );
|
||||||
},
|
},
|
||||||
releaseHandler: function(tracker, position, insideElmtPress, insideElmtRelease) {
|
releaseHandler: function(tracker, position, insideElmtPress, insideElmtRelease) {
|
||||||
if ( insideElmtPress && insideElmtRelease ) {
|
if ( insideElmtPress && insideElmtRelease ) {
|
||||||
outTo( _this, $.ButtonState.HOVER );
|
outTo( _this, $.ButtonState.HOVER );
|
||||||
this.raiseEvent( "onRelease", _this );
|
_this.raiseEvent( "onRelease", _this );
|
||||||
} else if ( insideElmtPress ) {
|
} else if ( insideElmtPress ) {
|
||||||
outTo( _this, $.ButtonState.GROUP );
|
outTo( _this, $.ButtonState.GROUP );
|
||||||
} else {
|
} else {
|
||||||
@ -213,8 +213,8 @@ function outTo( button, newState ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( newState <= $.ButtonState.GROUP && button.currentState == $.ButtonState.HOVER ) {
|
if ( newState <= $.ButtonState.GROUP && button.currentState == $.ButtonState.HOVER ) {
|
||||||
this.imgHover.style.visibility = "hidden";
|
button.imgHover.style.visibility = "hidden";
|
||||||
this.currentState = $.ButtonState.GROUP;
|
button.currentState = $.ButtonState.GROUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( button.newState <= $.ButtonState.REST && button.currentState == $.ButtonState.GROUP ) {
|
if ( button.newState <= $.ButtonState.REST && button.currentState == $.ButtonState.GROUP ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user