diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index f2ee7377eedcb8fb4e10eaf5e3476a8383eee464..323b546cb06b498ee44193417a453534e08b6b06 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -29,17 +29,17 @@ VuFind.lightbox = (function() { // Update content var _update = function(html) { if (!html.match) return; - // Deframe HTML - if(html.match('<!DOCTYPE html>')) { - html = $('<div>'+html+'</div>').find('.main > .container').html(); - } // Isolate successes - var testDiv = $('<div>'+html+'</div>'); - var alerts = testDiv.find('.alert-success'); + var htmlDiv = $('<div>'+html+'</div>'); + var alerts = htmlDiv.find('.alert-success'); if (alerts.length > 0) { showAlert(alerts[0].innerHTML, 'success'); return; } + // Deframe HTML + if(html.match('<!DOCTYPE html>')) { + html = htmlDiv.find('.main > .container').html(); + } // Fill HTML _html(html); _modal.modal('show');