mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +03:00
Merge pull request #15 from Ventero/imageload
Pass the correct object to image load callbacks.
This commit is contained in:
commit
d23851d5e5
@ -8181,10 +8181,10 @@ $.Drawer.prototype = {
|
||||
* @method
|
||||
* @param {String} src - The url of the image to load.
|
||||
* @param {Function} callback - The function that will be called with the
|
||||
* Image object as the only parameter, whether on 'load' or on 'abort'.
|
||||
* For now this means the callback is expected to distinguish between
|
||||
* error and success conditions by inspecting the Image object.
|
||||
* @return {Boolean} loading - Wheter the request was submitted or ignored
|
||||
* Image object as the only parameter if it was loaded successfully.
|
||||
* If an error occured, or the request timed out or was aborted,
|
||||
* the parameter is null instead.
|
||||
* @return {Boolean} loading - Wheter the request was submitted or ignored
|
||||
* based on OpenSeadragon.DEFAULT_SETTINGS.imageLoaderLimit.
|
||||
*/
|
||||
loadImage: function( src, callback ) {
|
||||
@ -8201,11 +8201,11 @@ $.Drawer.prototype = {
|
||||
|
||||
image = new Image();
|
||||
|
||||
complete = function( imagesrc ){
|
||||
complete = function( imagesrc, resultingImage ){
|
||||
_this.downloading--;
|
||||
if (typeof ( callback ) == "function") {
|
||||
try {
|
||||
callback( image );
|
||||
callback( resultingImage );
|
||||
} catch ( e ) {
|
||||
$.console.error(
|
||||
"%s while executing %s callback: %s",
|
||||
@ -8219,11 +8219,11 @@ $.Drawer.prototype = {
|
||||
};
|
||||
|
||||
image.onload = function(){
|
||||
finishLoadingImage( image, complete, true );
|
||||
finishLoadingImage( image, complete, true, jobid );
|
||||
};
|
||||
|
||||
image.onabort = image.onerror = function(){
|
||||
finishLoadingImage( image, complete, false );
|
||||
finishLoadingImage( image, complete, false, jobid );
|
||||
};
|
||||
|
||||
jobid = window.setTimeout( function(){
|
||||
|
@ -275,10 +275,10 @@ $.Drawer.prototype = {
|
||||
* @method
|
||||
* @param {String} src - The url of the image to load.
|
||||
* @param {Function} callback - The function that will be called with the
|
||||
* Image object as the only parameter, whether on 'load' or on 'abort'.
|
||||
* For now this means the callback is expected to distinguish between
|
||||
* error and success conditions by inspecting the Image object.
|
||||
* @return {Boolean} loading - Wheter the request was submitted or ignored
|
||||
* Image object as the only parameter if it was loaded successfully.
|
||||
* If an error occured, or the request timed out or was aborted,
|
||||
* the parameter is null instead.
|
||||
* @return {Boolean} loading - Wheter the request was submitted or ignored
|
||||
* based on OpenSeadragon.DEFAULT_SETTINGS.imageLoaderLimit.
|
||||
*/
|
||||
loadImage: function( src, callback ) {
|
||||
@ -295,11 +295,11 @@ $.Drawer.prototype = {
|
||||
|
||||
image = new Image();
|
||||
|
||||
complete = function( imagesrc ){
|
||||
complete = function( imagesrc, resultingImage ){
|
||||
_this.downloading--;
|
||||
if (typeof ( callback ) == "function") {
|
||||
try {
|
||||
callback( image );
|
||||
callback( resultingImage );
|
||||
} catch ( e ) {
|
||||
$.console.error(
|
||||
"%s while executing %s callback: %s",
|
||||
@ -313,11 +313,11 @@ $.Drawer.prototype = {
|
||||
};
|
||||
|
||||
image.onload = function(){
|
||||
finishLoadingImage( image, complete, true );
|
||||
finishLoadingImage( image, complete, true, jobid );
|
||||
};
|
||||
|
||||
image.onabort = image.onerror = function(){
|
||||
finishLoadingImage( image, complete, false );
|
||||
finishLoadingImage( image, complete, false, jobid );
|
||||
};
|
||||
|
||||
jobid = window.setTimeout( function(){
|
||||
|
Loading…
Reference in New Issue
Block a user