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_SOURCES = 'vufind_cart_src';
......@@ -88,20 +88,18 @@ function removeItemFromCart(id,source) {
// Ajax cart submission for the lightbox
function cartSubmit($form) {
var submit = $form.find('input[type="submit"][clicked=true]').attr('name');
switch(submit) {
case '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;
}
break;
default:
ajaxSubmit($form, changeModalContent);
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 {
ajaxSubmit($form, changeModalContent);
}
}
......@@ -198,7 +196,7 @@ $(document).ready(function() {
}
},
error:function(d,e) {
console.log(d,e); // Error reporting
//console.log(d,e); // Error reporting
}
});
return false;
......
......@@ -130,15 +130,8 @@ function displayLightboxError(message) {
* and handles the response according to the callback.
*
* 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) {
// 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(lightboxShown === false) {
$('#modal').modal('show');
......@@ -172,16 +165,12 @@ function getLightboxByUrl(url, post, callback) {
* and pushes the data and callback to the getLightboxByUrl
*/
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
var url = path+'/AJAX/JSON?method=getLightbox&submodule='+controller+'&subaction='+action;
if(get && 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