Browse Source

HUE-6077 [frontend] Avoid JB2 to pick up all the hashchanges events

Enrico Berti 8 years ago
parent
commit
59bae76287
1 changed files with 17 additions and 15 deletions
  1. 17 15
      apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

+ 17 - 15
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -1534,22 +1534,24 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
       % endif
 
       var loadHash = function () {
-        var h = window.location.hash;
-        if (h.indexOf('#!') === 0) {
-          h = h.substr(2);
-        }
+        if (window.location.pathname.indexOf('jobbrowser') > -1) {
+          var h = window.location.hash;
+          if (h.indexOf('#!') === 0) {
+            h = h.substr(2);
+          }
 
-        switch (h) {
-          case '':
-           break;
-          case 'jobs':
-          case 'workflows':
-          case 'schedules':
-          case 'bundles':
-            viewModel.selectInterface(h);
-            break;
-          default:
-            new Job(viewModel, {id: h}).fetchJob();
+          switch (h) {
+            case '':
+              break;
+            case 'jobs':
+            case 'workflows':
+            case 'schedules':
+            case 'bundles':
+              viewModel.selectInterface(h);
+              break;
+            default:
+              new Job(viewModel, {id: h}).fetchJob();
+          }
         }
       };