Browse Source

[oozie] Moving to a fork doesn't create a new node

Enrico Berti 11 years ago
parent
commit
6e50935558
1 changed files with 6 additions and 1 deletions
  1. 6 1
      apps/oozie/static/js/workflow-editor.ko.js

+ 6 - 1
apps/oozie/static/js/workflow-editor.ko.js

@@ -327,7 +327,7 @@ var Workflow = function (vm, workflow) {
     }
     }
   };
   };
   
   
-  self.moveNode = function(widget) { alert(vm.currentlyCreatingFork);
+  self.moveNode = function(widget) {
     if (! vm.currentlyCreatingFork) {
     if (! vm.currentlyCreatingFork) {
       var node = self.getNodeById(widget.id());
       var node = self.getNodeById(widget.id());
       var oldChildId = ko.mapping.toJS(node.get_link('to'))['to'];
       var oldChildId = ko.mapping.toJS(node.get_link('to'))['to'];
@@ -504,6 +504,11 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
         vm: self
         vm: self
       });
       });
 
 
+      if (self.currentlyDraggedWidget.id() != ""){
+        self.removeWidgetById(self.currentlyDraggedWidget.id());
+        _w = self.currentlyDraggedWidget;
+      }
+
       if (row.columns().length == 0) {
       if (row.columns().length == 0) {
         var _col = row.addColumn(null, atBeginning);
         var _col = row.addColumn(null, atBeginning);
         if (row.widgets().length > 0) {
         if (row.widgets().length > 0) {