Răsfoiți Sursa

Merge branch 'master' of rav.triplestart.com:jmudaka/stagfe2

Josh Kamau 5 ani în urmă
părinte
comite
32fed33ffb
1 a modificat fișierele cu 8 adăugiri și 4 ștergeri
  1. 8 4
      public/js/mc.js

+ 8 - 4
public/js/mc.js

@@ -64,10 +64,15 @@ var findEventHandlers = function (eventType, jqSelector) {
 };
 
 window.top.addEventListener('popstate', function(event) {
-    if(!!event.state) window.location = event.state;
+    window.setTimeout(function() {
+        if(!event) return;
+        var state = event.state;
+        if(state === '') state = '/';
+        if(state[0] !== '/') state = '/' + state;
+        if(!!state) fastLoad(state, false, true);
+    }, 0);
 });
 $(document).ready(function() {
-    window.top.history.replaceState(window.location.pathname, null, '/mc' + window.location.pathname);
     $(document).on('click', '.stag_rhs_toggle', function() {
         var state = window.top.toggleRHS(), icon = $(this).find('i');
         if(state === 'collapsed') {
@@ -81,7 +86,6 @@ $(document).ready(function() {
     if(body.is('.stag_rhs_collapsed')) {
         icon.removeClass().addClass('fa fa-arrow-left');
     }
-
     initFastLoad();
 });
 
@@ -120,7 +124,7 @@ function initFastLoad(_parent = false) {
             }
             return false;
         });
-        console.info('FastLoad enabled for ' + _a.innerText + ' [' + _a.href + ']');
+        // console.info('FastLoad enabled for ' + _a.innerText + ' [' + _a.href + ']');
     }
 
     // fast cache