[scheduler] Fix arrow positioning when adding widgets with horizontal scroll
@@ -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;
+ var heightCorrection = 0;
+ var widthCorrection = 0;
- if ($('.oozie_workflowComponents:visible').length > 0) {
- $painter = $('.oozie_workflowComponents:visible');
- correction = $('.page-content').scrollTop();
+ 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 = {};
