浏览代码

[oozie] Hide arrows on tab change on workflow dashboard

Enrico Berti 10 年之前
父节点
当前提交
71b5e84
共有 1 个文件被更改,包括 15 次插入2 次删除
  1. 15 2
      apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow.mako

+ 15 - 2
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow.mako

@@ -530,6 +530,12 @@ ${ utils.slaGlobal() }
 
 
     // force refresh on tab change
     // force refresh on tab change
     $("a[data-toggle='tab']").on("shown", function (e) {
     $("a[data-toggle='tab']").on("shown", function (e) {
+      if ($(e.target).attr("href") == "#graph") {
+        drawArrows();
+      }
+      else {
+        $("canvas").remove();
+      }
       if ($(e.target).attr("href") == "#definition") {
       if ($(e.target).attr("href") == "#definition") {
         codeMirror.refresh();
         codeMirror.refresh();
       }
       }
@@ -681,8 +687,15 @@ ${ utils.slaGlobal() }
       });
       });
     }
     }
 
 
-    $(window).resize(function () {
-      resizeLogs();
+    var resizeTimeout = -1;
+    $(window).on("resize", function () {
+      window.clearTimeout(resizeTimeout);
+      resizeTimeout = window.setTimeout(function () {
+        resizeLogs();
+        if ($("#graph").is(":visible")){
+          drawArrows();
+        }
+      }, 200);
     });
     });
 
 
     $("a[href='#log']").on("shown", function () {
     $("a[href='#log']").on("shown", function () {