From 627ce820290b0dcd7c978f2e88b4903bfc8bda9b Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Wed, 4 Nov 2015 16:04:47 +0200
Subject: [PATCH] Added a parameter to ajaxLoadTab() to make the addition of
 hash to the URL optional so that also the default tab can be loaded via ajax
 without jumping to the tab.

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

diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js
index 054d1703024..f59ffe8a3d3 100644
--- a/themes/bootstrap3/js/record.js
+++ b/themes/bootstrap3/js/record.js
@@ -146,7 +146,7 @@ function registerTabEvents() {
   });
 }
 
-function ajaxLoadTab(tabid) {
+function ajaxLoadTab(tabid, setHash) {
   // if we're flagged to skip AJAX for this tab, just return true and let the
   // browser handle it.
   if(document.getElementById(tabid).parentNode.className.indexOf('noajax') > -1) {
@@ -173,7 +173,9 @@ function ajaxLoadTab(tabid) {
       if(typeof syn_get_widget === "function") {
         syn_get_widget();
       }
-      window.location.hash = tabid;
+      if (typeof setHash == 'undefined' || setHash) {
+        window.location.hash = tabid;
+      }
     }
   });
   return false;
-- 
GitLab