diff --git a/themes/bootstrap3/js/cart.js b/themes/bootstrap3/js/cart.js index fec2e194c791cc729f24b9b0330466de3dd2b36c..05b7fc2b641bdc0a4f917a2c046041a0a83481a7 100644 --- a/themes/bootstrap3/js/cart.js +++ b/themes/bootstrap3/js/cart.js @@ -1,4 +1,4 @@ -/*global bulkActionLightboxHandler, Cookies, newAccountHandler, path, vufindString, Lightbox, updatePageForLogin */ +/*global Cookies, newAccountHandler, path, vufindString, Lightbox, updatePageForLogin */ var _CART_COOKIE = 'vufind_cart'; var _CART_COOKIE_SOURCES = 'vufind_cart_src'; @@ -158,7 +158,22 @@ function registerUpdateCart($form) { var lastCartSubmit = false; function cartSubmit($form) { lastCartSubmit = $form; - bulkActionLightboxHandler($form, false); + var submit = $form.find('input[type="submit"][clicked=true]').attr('name'); + if (submit == 'print') { + //redirect page + var checks = $form.find('input.checkbox-select-item:checked'); + if(checks.length > 0) { + var url = path+'/Records/Home?print=true'; + for(var i=0;i<checks.length;i++) { + url += '&id[]='+checks[i].value; + } + document.location.href = url; + } else { + Lightbox.displayError(vufindString['bulk_noitems_advice']); + } + } else { + Lightbox.submit($form, Lightbox.changeContent); + } } $(document).ready(function() { diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js index 9217295e83332b8145f6f207927b2f41d6cdb56c..2541c4ce08f314c7b5a896aaa642d96e00aab55b 100644 --- a/themes/bootstrap3/js/common.js +++ b/themes/bootstrap3/js/common.js @@ -406,13 +406,21 @@ $(document).ready(function() { Lightbox.close(); checkSaveStatuses(); }); - $('[name=bulkActionForm]').submit(function(evt) { - bulkActionLightboxHandler($(evt.target), true); + + $('[name=bulkActionForm]').submit(function() { + if($(this).find('[clicked=true]').attr('name') == 'print') { + Lightbox.submit($(this), Lightbox.close); + Lightbox.close(); + } else { + Lightbox.submit($(this), Lightbox.changeContent); + return false; + } }); $('[name=bulkActionForm]').find('[type=submit]').click(function() { $("[clicked=true]").attr("clicked", "false"); $(this).attr("clicked", "true"); }); + Lightbox.addFormHandler('feedback', function(evt) { var $form = $(evt.target); // Grabs hidden inputs