Preview Click Handler
Use onPreviewClick to open a lightbox or custom viewer when a thumbnail is clicked.
(function() {
new MultipleUpload('#demo', {
uploadUrl: '/api/upload',
multiple: true,
accept: 'image/*',
showThumbnails: true,
onPreviewClick: function(task) {
if (task.thumbnailUrl) {
MultipleUpload.showLightbox(task.thumbnailUrl, task.fileName);
}
}
});
})();
A hook on the thumbnail
onPreviewClick fires when the user clicks a file's preview and hands you the task, so you decide what happens. Without it the thumbnail is decoration; with it, it is the obvious way into a larger view.
What to open
A lightbox is the usual answer, but the task is yours to interpret — open a crop editor, jump to the record the file belongs to, or show the metadata you read during validation. The click already carries the user's intent, which is the hard part.