Browse Source

HUE-1176 [jb2] Remove graph arrows on tab hide

Enrico Berti 8 years ago
parent
commit
beda97b6af
1 changed files with 10 additions and 0 deletions
  1. 10 0
      apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

+ 10 - 0
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -901,6 +901,15 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
               }
             }
 
+            var arrowsPolling = function () {
+              if ($('#workflow-page-graph').is(':visible')){
+                window.setTimeout(arrowsPolling, 100);
+              }
+              else {
+                $('canvas').remove();
+              }
+            }
+
             $('canvas').remove();
 
             if (vm.job().type() === 'workflow') {
@@ -918,6 +927,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
                 success: function (response) {
                   $('#workflow-page-graph').html(response);
                   updateArrowPosition();
+                  arrowsPolling();
                 }
               });
             }