Skip to content

Commit 376fbeb

Browse files
committed
Keep very wide jobs in view when relevant
1 parent ef7589f commit 376fbeb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

view/adminhtml/web/js/lib/knockout/bindings/virtual-foreach.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ define([
6767
///////////////Horizontal Offset////////////////
6868
var timeOffset = viewModel.getOffset(cron, true);
6969
cronOffset.left = timeOffset + panelOffset();
70+
cronOffset.right = cronOffset.left + (cron.timelineWidth || 0);
7071

7172
return cronOffset;
7273
};
@@ -190,13 +191,21 @@ define([
190191
function isInBounds(cronOffset) {
191192
var cTop = cronOffset.top;
192193
var cLeft = cronOffset.left;
194+
var cRight = cronOffset.right;
193195

194196
if (cTop > topBoundry && cTop <= bottomBoundry) {
195197
if (cLeft > leftBoundry && cLeft <= rightBoundry) {
196198
return true;
197199
}
200+
if (cRight > leftBoundry && cRight <= rightBoundry) {
201+
return true;
202+
}
203+
if (cLeft < leftBoundry && cRight >= rightBoundry) {
204+
return true;
205+
}
198206
return false;
199207
}
208+
200209
isVerticallyInBounds = false;
201210
return false;
202211
}

view/adminhtml/web/js/timeline/timeline.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ define([
116116
}
117117
duration = Math.round(duration);
118118
duration = duration > minWidth ? duration : minWidth;
119+
job.timelineWidth = duration;
119120
return duration;
120121
},
121122

0 commit comments

Comments
 (0)