From 4b02d243ecfddab4eb3b8b141c1850f4d760daa8 Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Fri, 1 Apr 2016 13:52:00 -0400
Subject: [PATCH] No AJAX record tab improvements.

---
 themes/bootstrap3/js/record.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js
index 57d81b1547e..8ad05e8cd15 100644
--- a/themes/bootstrap3/js/record.js
+++ b/themes/bootstrap3/js/record.js
@@ -152,7 +152,7 @@ function ajaxLoadTab(tabid) {
   // we're flagged to skip AJAX for this tab, just return true and let the
   // browser handle it.
   var urlroot = document.URL.match(new RegExp('/[^/]+/'+id));
-  if(!urlroot || document.getElementById(tabid).parentNode.className.indexOf('noajax') > -1) {
+  if(!urlroot) {
     return true;
   }
   $.ajax({
@@ -221,9 +221,12 @@ $(document).ready(function(){
   registerTabEvents();
 
   $('ul.recordTabs a').click(function (e) {
-    if($(this).parents('li.active').length > 0) {
+    // Follow active and noajax tabs
+    var $li = $(this).parent();
+    if($li.hasClass('active') || $li.hasClass('noajax')) {
       return true;
     }
+    // Load tab
     var tabid = $(this).attr('id').toLowerCase();
     if($('#'+tabid+'-tab').length > 0) {
       $('#record-tabs .tab-pane.active').removeClass('active');
-- 
GitLab