diff --git a/web/js/refresh.js.php b/web/js/refresh.js.php index ebae4eccd4..6e46d5cb2b 100644 --- a/web/js/refresh.js.php +++ b/web/js/refresh.js.php @@ -21,27 +21,17 @@ var intervalId; 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); @@ -595,9 +585,14 @@ function getIndices(slots, time) { var bottom = $('.dwm_main thead tr:first th:first').outerHeight(); $('.dwm_main thead tr:nth-child(2) th').css('top', bottom + 'px'); - scrollToCurrentSlot(); - }).trigger('tableload'); + + scrollToCurrentSlot(); + });