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

Holds error handling 2: The Fixening. Bootstrap.

parent 0f801944
No related merge requests found
...@@ -450,10 +450,10 @@ $(document).ready(function() { ...@@ -450,10 +450,10 @@ $(document).ready(function() {
url:lastLightboxURL, url:lastLightboxURL,
data:data, data:data,
success:function(html) { // Success! success:function(html) { // Success!
var fi = html.indexOf('<div class="alert alert-error">')+31; var fi = html.indexOf('<div class="alert alert-error">');
if(fi > -1) { if(fi > -1) {
var li = html.indexOf('</div>', fi); var li = html.indexOf('</div>', fi+31);
displayLightboxError(html.substring(fi, li)); displayLightboxError(html.substring(fi+31, li));
} else { } else {
document.location.href = path+'/MyResearch/Holds'; document.location.href = path+'/MyResearch/Holds';
} }
...@@ -509,7 +509,15 @@ $(document).ready(function() { ...@@ -509,7 +509,15 @@ $(document).ready(function() {
$('.placehold').click(function() { $('.placehold').click(function() {
var params = deparam($(this).attr('href')); var params = deparam($(this).attr('href'));
params.hashKey = params.hashKey.split('#')[0]; // Remove #tabnav params.hashKey = params.hashKey.split('#')[0]; // Remove #tabnav
return getLightbox('Record', 'Hold', params, {}); return getLightbox('Record', 'Hold', params, {}, function(html) {
var fi = html.indexOf('<div class="alert alert-error">');
if(fi > -1) {
var li = html.indexOf('</div>', fi+31);
changeModalContent(html.substring(fi, li));
} else {
changeModalContent(html);
}
});
}); });
// Save record links // Save record links
$('.save-record').click(function() { $('.save-record').click(function() {
......
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