diff --git a/src/scripts/tutti/10_tasks.js b/src/scripts/tutti/10_tasks.js index 6bdc4e5..e952ec4 100644 --- a/src/scripts/tutti/10_tasks.js +++ b/src/scripts/tutti/10_tasks.js @@ -26,6 +26,10 @@ function item_open(item_id, item_type, pushState) throw new ReferenceError("ProjectUtils.projectUrl() undefined"); } + if ($(window).scrollTop() > 0) { + $("html, body").animate({scrollTop: 0 }, '500', 'swing'); + } + $('#col_right .col_header span.header_text').text(item_type + ' details'); // Style elements starting with item_type and dash, e.g. "#shot-uuid" @@ -346,10 +350,6 @@ $(function() { // rather than the thing we clicked on. var shot_id = e.delegateTarget.dataset.shotId; shot_open(shot_id); - - if ($(window).scrollTop() > 100) { - $("html, body").animate({scrollTop: 50 }, '500', 'swing'); - } }); $("a.task-link[data-task-id]").click(function(e) { @@ -361,9 +361,5 @@ $(function() { $('[id^="shot-"]').removeClass('active'); $(this).parent().parent().addClass('active'); } - - if ($(window).scrollTop() > 100) { - $("html, body").animate({scrollTop: 50 }, '500', 'swing'); - } }); });