From 2e1822f5aed54764f8b32994f16e290986e135b2 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Thu, 17 Jul 2014 10:32:14 -0400 Subject: [PATCH] VUFIND-1002 fix for Bootstrap 2. --- themes/bootstrap/js/common.js | 8 +++++--- themes/bootstrap/js/record.js | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/bootstrap/js/common.js b/themes/bootstrap/js/common.js index 026990ccbc9..77818460e00 100644 --- a/themes/bootstrap/js/common.js +++ b/themes/bootstrap/js/common.js @@ -10,6 +10,7 @@ function htmlEncode(value){ } function extractClassParams(str) { str = $(str).attr('class'); + if (typeof str === "undefined") return []; var params = {}; var classes = str.split(/\s+/); for(var i = 0; i < classes.length; i++) { @@ -229,7 +230,8 @@ function ajaxLogin(form) { if (response.status == 'OK') { updatePageForLogin(); // and we update the modal - if(Lightbox.lastPOST && Lightbox.lastPOST['loggingin']) { + var params = deparam(Lightbox.lastURL); + if (params['subaction'] == 'UserLogin') { Lightbox.close(); } else { Lightbox.getByUrl( @@ -388,7 +390,7 @@ $(document).ready(function() { }); Lightbox.addFormCallback('accountForm', function() { var params = deparam(Lightbox.openingURL); - if (params['subaction'] != 'Login') { + if (params['subaction'] != 'UserLogin') { Lightbox.getByUrl(Lightbox.openingURL); Lightbox.openingURL = false; } else { @@ -409,7 +411,7 @@ $(document).ready(function() { }); // Login link $('#loginOptions a.modal-link').click(function() { - return Lightbox.get('MyResearch','UserLogin',{},{'loggingin':true}); + return Lightbox.get('MyResearch','UserLogin'); }); // Email search link $('.mailSearch').click(function() { diff --git a/themes/bootstrap/js/record.js b/themes/bootstrap/js/record.js index 1e358ed3bd8..a89c08a8488 100644 --- a/themes/bootstrap/js/record.js +++ b/themes/bootstrap/js/record.js @@ -116,7 +116,6 @@ function registerAjaxCommentRecord() { refreshCommentList(id, recordSource); $(form).find('textarea[name="comment"]').val(''); } else if (response.status == 'NEED_AUTH') { - data['loggingin'] = true; Lightbox.addCloseAction(function() { $.ajax({ type: 'POST', -- GitLab