Ver Fonte

HUE-9136 [scheduler] Fix arrow positioning when adding widgets with horizontal scroll

Johan Ahlen há 5 anos atrás
pai
commit
aa0cc34d08
1 ficheiros alterados com 14 adições e 11 exclusões
  1. 14 11
      apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js

+ 14 - 11
apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js

@@ -1267,22 +1267,25 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
       var _to = $("#wdg_" + (typeof toId == "function" ? toId() : toId));
       if (_from.length > 0 && _to.length > 0) {
         var $painter = $(document.body);
-        var correction = 0;
-
-        if ($('.oozie_workflowComponents:visible').length > 0) {
-          $painter = $('.oozie_workflowComponents:visible');
-          correction = $('.page-content').scrollTop();
+        var heightCorrection = 0;
+        var widthCorrection = 0;
+
+        var $workflowWidgets = $('.workflow-widgets');
+        if ($workflowWidgets.length > 0) {
+          $painter = $workflowWidgets;
+          heightCorrection = $workflowWidgets.scrollTop();
+          widthCorrection = $workflowWidgets.scrollLeft();
         }
 
         var _fromCenter = {
-          x: _from.position().left + _from.outerWidth() / 2,
-          y: _from.position().top + correction + _from.outerHeight() + 3
-        }
+          x: _from.position().left + widthCorrection + _from.outerWidth() / 2,
+          y: _from.position().top + heightCorrection + _from.outerHeight() + 3
+        };
 
         var _toCenter = {
-          x: _to.position().left + _to.outerWidth() / 2,
-          y: _to.position().top + correction - 5
-        }
+          x: _to.position().left + widthCorrection + _to.outerWidth() / 2,
+          y: _to.position().top + heightCorrection - 5
+        };
 
         var _curveCoords = {};