mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 23:03:13 +03:00
Removed createCallback function
This commit is contained in:
parent
ebab356c20
commit
3fc156d513
@ -2252,42 +2252,6 @@ function OpenSeadragon( options ){
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Similar to OpenSeadragon.delegate, but it does not immediately call
|
|
||||||
* the method on the object, returning a function which can be called
|
|
||||||
* repeatedly to delegate the method. It also allows additional arguments
|
|
||||||
* to be passed during construction which will be added during each
|
|
||||||
* invocation, and each invocation can add additional arguments as well.
|
|
||||||
*
|
|
||||||
* @function
|
|
||||||
* @param {Object} object
|
|
||||||
* @param {Function} method
|
|
||||||
* @param [args] any additional arguments are passed as arguments to the
|
|
||||||
* created callback
|
|
||||||
* @returns {Function}
|
|
||||||
*/
|
|
||||||
createCallback: function( object, method ) {
|
|
||||||
//TODO: This pattern is painful to use and debug. It's much cleaner
|
|
||||||
// to use pinning plus anonymous functions. Get rid of this
|
|
||||||
// pattern!
|
|
||||||
var initialArgs = [],
|
|
||||||
i;
|
|
||||||
for ( i = 2; i < arguments.length; i++ ) {
|
|
||||||
initialArgs.push( arguments[ i ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
return function() {
|
|
||||||
var args = initialArgs.concat( [] ),
|
|
||||||
i;
|
|
||||||
for ( i = 0; i < arguments.length; i++ ) {
|
|
||||||
args.push( arguments[ i ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
return method.apply( object, args );
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the value of a url parameter from the window.location string.
|
* Retrieves the value of a url parameter from the window.location string.
|
||||||
* @function
|
* @function
|
||||||
|
Loading…
x
Reference in New Issue
Block a user