Skip to content

Commit

Permalink
123-comment-scroll: add logic to keep page position.
Browse files Browse the repository at this point in the history
  • Loading branch information
635487 committed Jun 11, 2024
1 parent cbc4b9b commit 8c0c10f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sde_indexing_helper/static/js/collection_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,15 @@ function postDocTypeChange(collection_id, docType) {
$(document).ready(function() {
if (localStorage.getItem("WorkflowStatusChange")) {
toastr.success("Workflow Status Updated!");
localStorage.removeItem("WorkflowStatusChange")
localStorage.removeItem("WorkflowStatusChange");
}
})

//Scroll position for comments
$(document).ready(function() {
if (localStorage.getItem("commentScroll")) {
$(window).scrollTop(localStorage.getItem("commentScroll"));
localStorage.removeItem("commentScroll");
}
})

Expand Down Expand Up @@ -401,4 +408,7 @@ function handleWorkflowStatusSelect() {

$(document).ready(function () {
handleWorkflowStatusSelect();
$("button[name='comment_button']").click(function() {
localStorage.setItem("commentScroll", $(window).scrollTop());
})
});

0 comments on commit 8c0c10f

Please sign in to comment.