diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 614aee319624c8d19bf8a8865eda54397edc33ac..dc1e07dd9b788f35fcaf5ba0a975f9d1093537f3 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -180,10 +180,16 @@ VuFind.lightbox = (function() { } } // onclose behavior - if("string" === typeof dataset.lightboxOnclose && "function" === typeof window[dataset.lightboxOnclose]) { - document.addEventListener('VuFind.lightbox.closed', function() { - window[dataset.lightboxOnclose](); - }, false); + if("string" === typeof dataset.lightboxOnclose) { + if ("function" === typeof window[dataset.lightboxOnclose]) { + document.addEventListener('VuFind.lightbox.closed', function() { + window[dataset.lightboxOnclose](); + }, false); + } else { + document.addEventListener('VuFind.lightbox.closed', function() { + eval('(function(event, data) {' + dataset.lightboxOnclose + '}())'); // inline code + }); + } } } // Loading diff --git a/themes/bootstrap3/templates/record/save.phtml b/themes/bootstrap3/templates/record/save.phtml index febb5b1783eaa52229e5e415fa946b4e0cec1eb4..d53c1bb5f55a3c016116d6cfed7772acc722ddb2 100644 --- a/themes/bootstrap3/templates/record/save.phtml +++ b/themes/bootstrap3/templates/record/save.phtml @@ -8,7 +8,7 @@ . '<li class="active">' . $this->transEsc('Save') . '</li>'; ?> <h2><?=$this->transEsc("add_favorite_prefix") ?> <span class="title-in-heading"><?=$this->escapeHtml($this->driver->getBreadcrumb())?></span> <?=$this->transEsc("add_favorite_suffix") ?></h2> -<form id="edit-save-form" class="form-horizontal" method="post" action="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" name="saveRecord" data-lightbox-onsubmit="VuFind.lightbox.refreshOnClose=true"> +<form id="edit-save-form" class="form-horizontal" method="post" action="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" name="saveRecord" data-lightbox-onclose="checkSaveStatuses();"> <input type="hidden" name="submit" value="1" /> <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId()) ?>" /> <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" />