Skip to content
Snippets Groups Projects
Commit 1bce726f authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Add data-lightbox-post and data-lightbox-href back in.

parent c040c38f
No related merge requests found
...@@ -106,15 +106,22 @@ VuFind.lightbox = (function() { ...@@ -106,15 +106,22 @@ VuFind.lightbox = (function() {
/** /**
* Modal link data options * 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) { var _constrainLink = function(event) {
if (typeof this.dataset.lightboxIgnore != 'undefined') { if (typeof this.dataset.lightboxIgnore != 'undefined') {
return true; return true;
} }
if (this.href.length > 1) { if (this.href.length > 1) {
event.preventDefault(); event.preventDefault();
ajax({url: this.href}); 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; _currentUrl = this.href;
VuFind.modal('show'); VuFind.modal('show');
return false; return false;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment