Scroll to top after clicking on shots/tasks

This commit is contained in:
2016-09-29 14:29:09 +02:00
parent 001a313e1e
commit 55aebebadb

View File

@@ -269,11 +269,20 @@ $(function() {
// rather than the thing we clicked on.
var shot_id = e.delegateTarget.dataset.shotId;
shot_open(shot_id);
if ($(window).scrollTop() > 270) {
$("html, body").animate({scrollTop: 0 }, '500', 'swing');
}
});
$("a.task-link[data-task-id]").click(function(e) {
e.preventDefault();
var task_id = e.delegateTarget.dataset.taskId;
task_open(task_id);
if ($(window).scrollTop() > 270) {
$("html, body").animate({scrollTop: 0 }, '500', 'swing');
}
});
});