diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 1235a36d575a3b752c135be6aaac7a3e856fc5ab..e3727b6c3e5f80c949a66dc16d9d928762317f83 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -229,12 +229,25 @@ function recordDocReady() { $('.record-tabs .nav-tabs a').click(function (e) { 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')) { + if ($li.hasClass('active')) { return true; } var tabid = this.className; var $top = $(this).closest('.record-tabs'); + // if we're flagged to skip AJAX for this tab, we need special behavior: + if ($li.hasClass('noajax')) { + // if this was the initially active tab, we have moved away from it and + // now need to return -- just switch it back on. + if ($li.hasClass('initiallyActive')) { + $(this).tab('show'); + $top.find('.tab-pane.active').removeClass('active'); + $top.find('.'+tabid+'-tab').addClass('active'); + window.location.hash = 'tabnav'; + return false; + } + // otherwise, we need to let the browser follow the link: + return true; + } $top.find('.tab-pane.active').removeClass('active'); $(this).tab('show'); if ($top.find('.'+tabid+'-tab').length > 0) {