Просмотр исходного кода

BugFix: The problem when disabling pushing states with History API when tabs changes

Yuki Takei 8 лет назад
Родитель
Сommit
6eee05c15d
2 измененных файлов с 15 добавлено и 0 удалено
  1. 4 0
      CHANGES.md
  2. 11 0
      resource/js/legacy/crowi.js

+ 4 - 0
CHANGES.md

@@ -1,6 +1,10 @@
 CHANGES
 ========
 
+## 1.2.13
+
+* Fix: The problem when disabling pushing states with History API when tabs changes 
+
 ## 1.2.12
 
 * Improvement: Enabled to switch whether to push states with History API when tabs changes 

+ 11 - 0
resource/js/legacy/crowi.js

@@ -766,6 +766,17 @@ $(function() {
       window.history.pushState('', '',  location.href.replace(location.hash, ''));
     });
   }
+  else {
+    $('a[data-toggle="tab"][href="#revision-history"]').on('show.bs.tab', function() {
+      window.history.replaceState('', 'History', '#revision-history');
+    });
+    $('a[data-toggle="tab"][href="#edit-form"]').on('show.bs.tab', function() {
+      window.history.replaceState('', 'Edit', '#edit-form');
+    });
+    $('a[data-toggle="tab"][href="#revision-body"]').on('show.bs.tab', function() {
+      window.history.replaceState('', '',  location.href.replace(location.hash, ''));
+    });
+  }
 });
 
 Crowi.getRevisionBodyContent = function() {