Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Jun 10, 2024
1 parent 75ba34e commit 1a3299e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions web/js/refresh.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,17 @@
var intervalId;

<?php
// If the table container hasn't already been scrolled, and it's scrollable,
// then scroll so that the current time is visible.
// If the table container is scrollable, then scroll so that the current time is visible.
?>
function scrollToCurrentSlot() {
var table = $('.dwm_main');
var timelineVertical = table.find('thead').data('timeline-vertical');
var container = table.parent();
var scroll, scrollTo, scrollable;
var scrollTo, scrollable;

if (timelineVertical)
{
scroll = container.scrollLeft();
scrollable = container.isHScrollable();
}
else
{
scroll = container.scrollTop();
scrollable = container.isVScrollable();
}
scrollable = (timelineVertical) ? container.isHScrollable() : container.isVScrollable();

if ((scroll === 0) && scrollable)
if (scrollable)
{
var slots = table.find('thead').data('slots');
var nowSlotIndices = Timeline.search(slots);
Expand Down

0 comments on commit 1a3299e

Please sign in to comment.