Skip to content

Commit

Permalink
Keep very wide jobs in view when relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Nov 3, 2023
1 parent ef7589f commit 376fbeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ define([
///////////////Horizontal Offset////////////////
var timeOffset = viewModel.getOffset(cron, true);
cronOffset.left = timeOffset + panelOffset();
cronOffset.right = cronOffset.left + (cron.timelineWidth || 0);

return cronOffset;
};
Expand Down Expand Up @@ -190,13 +191,21 @@ define([
function isInBounds(cronOffset) {
var cTop = cronOffset.top;
var cLeft = cronOffset.left;
var cRight = cronOffset.right;

if (cTop > topBoundry && cTop <= bottomBoundry) {
if (cLeft > leftBoundry && cLeft <= rightBoundry) {
return true;
}
if (cRight > leftBoundry && cRight <= rightBoundry) {
return true;
}
if (cLeft < leftBoundry && cRight >= rightBoundry) {
return true;
}
return false;
}

isVerticallyInBounds = false;
return false;
}
Expand Down
1 change: 1 addition & 0 deletions view/adminhtml/web/js/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ define([
}
duration = Math.round(duration);
duration = duration > minWidth ? duration : minWidth;
job.timelineWidth = duration;
return duration;
},

Expand Down

0 comments on commit 376fbeb

Please sign in to comment.