소스 검색

[oozie] Drag a node onto workflow editor.

When adding a new node, users are now able to drag the node onto the canvas.
In order to save the workflow, the user will likely have to edit the node first.
Catching the 'dragstop' event, which should be called after 'drop'.
Cannot handle the 'drop' event since the workflow editor must use them and stops event bubbling.
abec 13 년 전
부모
커밋
64a2df6
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      apps/oozie/src/oozie/templates/editor/edit_workflow.mako

+ 2 - 1
apps/oozie/src/oozie/templates/editor/edit_workflow.mako

@@ -574,6 +574,7 @@ $('#workflow').on('mousedown', '.new-node-link', function(e) {
   var old_position = el.offset();
 
   // Trigger fake mousedown event to start dragging node.
+  var is_dirty = workflow.is_dirty();
   el.offset({ top: e.pageY - el.height()/10, left: e.pageX - el.width()/10 });
   el.trigger($.Event("mousedown", {pageX: e.pageX, pageY: e.pageY, target: el[0], which: 1}));
 
@@ -582,7 +583,7 @@ $('#workflow').on('mousedown', '.new-node-link', function(e) {
     node.detach();
     node.erase();
     modal.hide();
-    workflow.is_dirty( false );
+    workflow.is_dirty( is_dirty );
     $('#workflow').trigger('workflow:rebuild');
   };