فهرست منبع

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

Yuki Takei 8 سال پیش
والد
کامیت
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
 CHANGES
 ========
 ========
 
 
+## 1.2.13
+
+* Fix: The problem when disabling pushing states with History API when tabs changes 
+
 ## 1.2.12
 ## 1.2.12
 
 
 * Improvement: Enabled to switch whether to push states with History API when tabs changes 
 * 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, ''));
       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() {
 Crowi.getRevisionBodyContent = function() {