Created
May 30, 2023 01:29
-
-
Save gslin/3466ea4d1a2128cb20489294aadbfcf7 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
/** | |
* Event handler for clicking on an image thumbnail | |
* | |
* @param {jQuery.Event} ev | |
* @ignore | |
*/ | |
function onClickImage(ev) { | |
ev.preventDefault(); | |
routeThumbnail($(this).data("thumb")); | |
} | |
/** | |
* Add routes to images and handle clicks | |
* | |
* @method | |
* @ignore | |
* @param {jQuery.Object} [$container] Optional container to search within | |
*/ | |
function initMediaViewer($container) { | |
currentPageHTMLParser.getThumbnails($container).forEach(function (thumb) { | |
thumb.$el.off().data("thumb", thumb).on("click", onClickImage); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment