From 1bce726f74854cc7184434051da309af85216f5e Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Fri, 4 Mar 2016 17:11:21 -0500 Subject: [PATCH] Add data-lightbox-post and data-lightbox-href back in. --- themes/bootstrap3/js/lightbox.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 467c940ad7c..164e496a9ac 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -106,15 +106,22 @@ VuFind.lightbox = (function() { /** * Modal link data options * - * data-lightbox-ignore = do not open this link in lightbox + * data-lightbox-href = go to this url instead + * data-lightbox-ignore = do not open this link in lightbox + * data-lightbox-post = post data */ var _constrainLink = function(event) { if (typeof this.dataset.lightboxIgnore != 'undefined') { return true; } if (this.href.length > 1) { - event.preventDefault(); - ajax({url: this.href}); + event.preventDefault(); + var obj = {url: this.dataset.lightboxHref || this.href}; + if("string" === typeof this.dataset.lightboxPost) { + obj.type = 'POST'; + obj.data = this.dataset.lightboxPost; + } + ajax(obj); _currentUrl = this.href; VuFind.modal('show'); return false; -- GitLab