Explorar o código

[oozie] Fix widget predecessor and successor

Enrico Berti %!s(int64=11) %!d(string=hai) anos
pai
achega
e015ec79ca
Modificáronse 1 ficheiros con 16 adicións e 1 borrados
  1. 16 1
      apps/oozie/static/js/workflow-editor.ko.js

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

@@ -395,7 +395,22 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
 
       var _newRow = null;
       if (typeof atBeginning != "undefined"){
-        _newRow = _parentCol.addEmptyRow(atBeginning);
+        if (atBeginning){
+          if (_parentCol.rows().length > 0 && _parentCol.rows()[0].widgets() && _parentCol.rows()[0].widgets().length > 0  && _parentCol.rows()[0].widgets()[0].widgetType()=="start-widget"){
+            _newRow = _parentCol.addEmptyRow(false, 1);
+          }
+          else {
+            _newRow = _parentCol.addEmptyRow(atBeginning);
+          }
+        }
+        else {
+          if (_parentCol.rows().length > 0 && _parentCol.rows()[0].widgets() && _parentCol.rows()[0].widgets().length > 0  && _parentCol.rows()[0].widgets()[0].widgetType()=="start-widget"){
+            _newRow = _parentCol.addEmptyRow(false, _parentCol.rows().length - 1);
+          }
+          else {
+            _newRow = _parentCol.addEmptyRow(atBeginning);
+          }
+        }
       }
       else {
         var _rowIdx = 0;