Scroll all the way to the top when opening a shot/task.
This way the status bar is in view too, which is essential when loading fails for some reason.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user