From 883936d8209cfb1740dc170904337cb0180367da Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Fri, 15 Apr 2016 15:38:37 -0400
Subject: [PATCH] Show only errors when they occur in holdings lightboxes.

---
 themes/bootstrap3/js/lightbox.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js
index f7f9d446d00..affb977375d 100644
--- a/themes/bootstrap3/js/lightbox.js
+++ b/themes/bootstrap3/js/lightbox.js
@@ -143,6 +143,14 @@ VuFind.register('lightbox', function() {
           _refreshPage();
           return;
         }
+        // Place Hold error isolation
+        if (obj.url.match(/\/Record/) && (obj.url.match(/Hold\?/) || obj.url.match(/Request\?/))) {
+          var error = $('<div/>').html(html).find('.flash-message.alert-danger');
+          if (error.length) {
+            showAlert(error[0].innerHTML, 'danger');
+            return false;
+          }
+        }
         if ( // Close the lightbox after deliberate login
           obj.method                                                                // is a form
           && ((obj.url.match(/MyResearch/) && !obj.url.match(/Bulk/))               // that matches login/create account
-- 
GitLab