The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 3ffd175e authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Checkstyles for BS js.

parent 3975ada7
No related merge requests found
/*global Cookies, lightbox, vufindString */ /*global Cookies, path, vufindString, lightbox, addLightboxFormHandler, addLightboxOnClose, ajaxSubmit, changeModalContent, getDataFromForm, lastLightboxPOST, modalXHR */
var _CART_COOKIE = 'vufind_cart'; var _CART_COOKIE = 'vufind_cart';
var _CART_COOKIE_SOURCES = 'vufind_cart_src'; var _CART_COOKIE_SOURCES = 'vufind_cart_src';
...@@ -88,20 +88,18 @@ function removeItemFromCart(id,source) { ...@@ -88,20 +88,18 @@ function removeItemFromCart(id,source) {
// Ajax cart submission for the lightbox // Ajax cart submission for the lightbox
function cartSubmit($form) { function cartSubmit($form) {
var submit = $form.find('input[type="submit"][clicked=true]').attr('name'); var submit = $form.find('input[type="submit"][clicked=true]').attr('name');
switch(submit) { if (submit == 'print') {
case 'print': //redirect page
//redirect page var checks = $form.find('input.checkbox-select-item:checked');
var checks = $form.find('input.checkbox-select-item:checked'); if(checks.length > 0) {
if(checks.length > 0) { var url = path+'/Records/Home?print=true';
var url = path+'/Records/Home?print=true'; for(var i=0;i<checks.length;i++) {
for(var i=0;i<checks.length;i++) { url += '&id[]='+checks[i].value;
url += '&id[]='+checks[i].value; }
} document.location.href = url;
document.location.href = url; }
} } else {
break; ajaxSubmit($form, changeModalContent);
default:
ajaxSubmit($form, changeModalContent);
} }
} }
...@@ -198,7 +196,7 @@ $(document).ready(function() { ...@@ -198,7 +196,7 @@ $(document).ready(function() {
} }
}, },
error:function(d,e) { error:function(d,e) {
console.log(d,e); // Error reporting //console.log(d,e); // Error reporting
} }
}); });
return false; return false;
......
...@@ -130,15 +130,8 @@ function displayLightboxError(message) { ...@@ -130,15 +130,8 @@ function displayLightboxError(message) {
* and handles the response according to the callback. * and handles the response according to the callback.
* *
* Unless there's an error, default callback is changeModalContent * Unless there's an error, default callback is changeModalContent
*
* Pop controls whether or not the callback is used immediately
* after loading or to be stashed for later when it closes. Default true.
*/ */
function getLightboxByUrl(url, post, callback) { function getLightboxByUrl(url, post, callback) {
// Pop determines if we execute the callback immediately or later
if(typeof pop === "undefined") {
pop = true;
}
// If the lightbox isn't visible, fix that // If the lightbox isn't visible, fix that
if(lightboxShown === false) { if(lightboxShown === false) {
$('#modal').modal('show'); $('#modal').modal('show');
...@@ -172,16 +165,12 @@ function getLightboxByUrl(url, post, callback) { ...@@ -172,16 +165,12 @@ function getLightboxByUrl(url, post, callback) {
* and pushes the data and callback to the getLightboxByUrl * and pushes the data and callback to the getLightboxByUrl
*/ */
function getLightbox(controller, action, get, post, callback) { function getLightbox(controller, action, get, post, callback) {
// Pop determines if we execute the callback immediately or later
if(typeof pop === "undefined") {
pop = true;
}
// Build URL // Build URL
var url = path+'/AJAX/JSON?method=getLightbox&submodule='+controller+'&subaction='+action; var url = path+'/AJAX/JSON?method=getLightbox&submodule='+controller+'&subaction='+action;
if(get && get !== {}) { if(get && get !== {}) {
url += '&'+$.param(get); url += '&'+$.param(get);
} }
return getLightboxByUrl(url, post, callback, pop); return getLightboxByUrl(url, post, callback);
} }
/**********************************/ /**********************************/
......
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