diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 58989cdac67c5a5fc97f3e66ef84173973977766..1235a36d575a3b752c135be6aaac7a3e856fc5ab 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -227,7 +227,10 @@ $(window).on('hashchange', applyRecordTabHash); function recordDocReady() { $('.record-tabs .nav-tabs a').click(function (e) { - if ($(this.parentNode).hasClass('active')) { + var $li = $(this).parent(); + // If it's an active tab, click again to follow to a shareable link. + // if we're flagged to skip AJAX for this tab, just return true and let the browser handle it. + if($li.hasClass('active') || $li.hasClass('noajax')) { return true; } var tabid = this.className; @@ -239,10 +242,6 @@ function recordDocReady() { window.location.hash = tabid; return false; } else { - // if we're flagged to skip AJAX for this tab, just return true and let the browser handle it. - if ($(this.parentNode).hasClass('noajax')) { - return true; - } var newTab = $('<div class="tab-pane active '+tabid+'-tab"><i class="fa fa-spinner fa-spin"></i> '+VuFind.translate('loading')+'...</div>'); $top.find('.tab-content').append(newTab); return ajaxLoadTab(newTab, tabid, !$(this).parent().hasClass('initiallyActive'));