Created
September 21, 2010 19:36
-
-
Save kaylarose/590372 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This will patch the jquery.iviewer plugin to accept a post-zoom callback function | |
//http://github.com/can3p/iviewer/issues/issue/1 | |
/** | |
* event is triggered when zoom value is changed | |
* @param int new zoom value | |
* @return boolean if false zoom action is aborted | |
**/ | |
onZoom: null, | |
//begin patch | |
/** | |
* event is triggered AFTER the image is zoomed | |
* @param int new zoom value | |
* @return void | |
**/ | |
afterZoom: null, | |
//end | |
... | |
/** | |
* set image scale to the new_zoom | |
* @param new_zoom image scale in % | |
**/ | |
set_zoom: function(new_zoom) | |
{ | |
if(this.settings.onZoom && this.settings.onZoom.call(this, new_zoom) == false) | |
{ | |
return; | |
} | |
...... | |
this.current_zoom = new_zoom; | |
//begin patch | |
if($.isFunction(this.settings.afterZoom)) | |
{ | |
this.settings.afterZoom.call(this, new_zoom); | |
} | |
//end | |
this.update_status(); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment