Skip to content

Commit 2eaa4dd

Browse files
author
Akhil S Naik
authored
[jb] GH-1721 HUE-9419 curvedArrow issues when Job Dashboard has horizontal Scrollbar (asnaik) (#1722)
1 parent 63b03e8 commit 2eaa4dd

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

apps/jobbrowser/src/jobbrowser/static/jobbrowser/css/jobbrowser-embeddable.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/jobbrowser/src/jobbrowser/static/jobbrowser/less/jobbrowser-embeddable.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,4 +395,8 @@
395395
display: inline-block;
396396
float: initial;
397397
}
398+
399+
#workflow-page-graph {
400+
position: relative;
401+
}
398402
}

apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3420,7 +3420,9 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
34203420
top: 0,
34213421
left: 0
34223422
}
3423-
3423+
self.redrawOnResize = function(){
3424+
huePubSub.publish('graph.draw.arrows');
3425+
}
34243426
self.initialArrowsDrawingCount = 0;
34253427
self.initialArrowsDrawing = function() {
34263428
if (self.initialArrowsDrawingCount < 20) {
@@ -3438,21 +3440,6 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
34383440
}
34393441
}
34403442
3441-
self.updateArrowsInterval = -1;
3442-
self.updateArrows = function() {
3443-
if ($('canvas').length > 0 && $('canvas').position().top !== self.lastArrowsPosition.top && $('canvas').position().left !== self.lastArrowsPosition.left) {
3444-
self.lastArrowsPosition = $('canvas').position();
3445-
}
3446-
if ($('#workflow-page-graph${ SUFFIX }').is(':visible')){
3447-
if ($('canvas').length === 0){
3448-
huePubSub.publish('graph.draw.arrows');
3449-
}
3450-
}
3451-
else {
3452-
$('canvas').remove();
3453-
}
3454-
}
3455-
34563443
self.updateWorkflowGraph = function() {
34573444
huePubSub.publish('graph.stop.refresh.view');
34583445
@@ -3478,9 +3465,8 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
34783465
response: response,
34793466
callback: function (r) {
34803467
$('#workflow-page-graph${ SUFFIX }').html(r);
3481-
window.clearInterval(self.updateArrowsInterval);
34823468
self.initialArrowsDrawing();
3483-
self.updateArrowsInterval = window.setInterval(self.updateArrows, 100, 'jobbrowser');
3469+
$(window).on('resize',self.redrawOnResize);
34843470
}
34853471
});
34863472
}

apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,12 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
12871287
heightCorrection = $workflowWidgets.scrollTop();
12881288
widthCorrection = $workflowWidgets.scrollLeft();
12891289
}
1290+
var $jobBrowserGraphTab = $('#workflow-page-graph');
1291+
if ($jobBrowserGraphTab.length > 0) {
1292+
$painter = $jobBrowserGraphTab;
1293+
heightCorrection = $jobBrowserGraphTab.scrollTop();
1294+
widthCorrection = $jobBrowserGraphTab.scrollLeft();
1295+
}
12901296

12911297
var _fromCenter = {
12921298
x: _from.position().left + widthCorrection + _from.outerWidth() / 2,

0 commit comments

Comments
 (0)