From 863c2112ffb4ac27cd48155015a7a18403739a0e Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Fri, 12 Feb 2016 13:38:27 -0500
Subject: [PATCH] .done and lightbox adjustments.

---
 themes/bootstrap3/js/common.js   |  2 +-
 themes/bootstrap3/js/lightbox.js |  5 +----
 themes/bootstrap3/js/record.js   | 14 ++++++--------
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js
index 1481a818bb8..57536d19aeb 100644
--- a/themes/bootstrap3/js/common.js
+++ b/themes/bootstrap3/js/common.js
@@ -194,7 +194,7 @@ function newAccountHandler(html) {
 
 // This is a full handler for the login form
 function ajaxLogin(form) {
-  $.ajax({
+  Lightbox.ajax({
     url: VuFind.getPath() + '/AJAX/JSON?method=getSalt',
     dataType: 'json'
   })
diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js
index 48ec009a4c3..0b7c1c20bd6 100644
--- a/themes/bootstrap3/js/lightbox.js
+++ b/themes/bootstrap3/js/lightbox.js
@@ -475,7 +475,7 @@ $(document).ready(function() {
   });
 
   Lightbox.addFormHandler('exportForm', function(evt) {
-    $.ajax({
+    Lightbox.ajax({
       url: VuFind.getPath() + '/AJAX/JSON?' + $.param({method:'exportFavorites'}),
       type:'POST',
       dataType:'json',
@@ -489,9 +489,6 @@ $(document).ready(function() {
       } else {
         Lightbox.changeContent(data.data.result_additional);
       }
-    })
-    .fail(function(d,e) {
-      //console.log(d,e); // Error reporting
     });
     return false;
   });
diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js
index fe148626036..8031365b325 100644
--- a/themes/bootstrap3/js/record.js
+++ b/themes/bootstrap3/js/record.js
@@ -180,14 +180,12 @@ function refreshTagList(target, loggedin) {
       dataType: 'json',
       url: url
     })
-    .always(function(response) {
-      if(response.status == 200) {
-        $tagList.replaceWith(response.responseText);
-        if(loggedin) {
-          $tagList.addClass('loggedin');
-        } else {
-          $tagList.removeClass('loggedin');
-        }
+    .done(function(response) {
+      $tagList.replaceWith(response.responseText);
+      if(loggedin) {
+        $tagList.addClass('loggedin');
+      } else {
+        $tagList.removeClass('loggedin');
       }
     });
   }
-- 
GitLab