From bae4aeb488deeaaff70b83a6e963961c8a30aded Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Fri, 1 Apr 2016 13:54:23 -0400 Subject: [PATCH] No AJAX record tab improvements. --- themes/bootstrap3/js/record.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 58989cdac67..1235a36d575 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')); -- GitLab