File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
sde_indexing_helper/static/js Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1465,7 +1465,8 @@ function handleHideorShowSubmitButton() {
14651465}
14661466
14671467function handleDocumentTypeSelect ( ) {
1468- $ ( "body" ) . on ( "click" , ".document_type_select" , function ( ) {
1468+ $ ( "body" ) . on ( "click" , ".document_type_select" , function ( e ) {
1469+ e . preventDefault ( ) ;
14691470 $match_pattern = $ ( this )
14701471 . parents ( ".document_type_dropdown" )
14711472 . data ( "match-pattern" ) ;
@@ -1646,6 +1647,8 @@ function postDocumentTypePatterns(
16461647 return ;
16471648 }
16481649
1650+ const scrollPosition = window . scrollY ;
1651+
16491652 $ . ajax ( {
16501653 url : "/api/document-type-patterns/" ,
16511654 type : "POST" ,
@@ -1657,7 +1660,9 @@ function postDocumentTypePatterns(
16571660 csrfmiddlewaretoken : csrftoken ,
16581661 } ,
16591662 success : function ( data ) {
1660- $ ( "#delta_urls_table" ) . DataTable ( ) . ajax . reload ( null , false ) ;
1663+ $ ( "#delta_urls_table" ) . DataTable ( ) . ajax . reload ( function ( ) {
1664+ window . scrollTo ( 0 , scrollPosition ) ;
1665+ } , false ) ;
16611666 $ ( "#document_type_patterns_table" ) . DataTable ( ) . ajax . reload ( null , false ) ;
16621667 if ( currentTab === "" ) { //Only add a notification if we are on the first tab
16631668 newDocumentTypePatternsCount = newDocumentTypePatternsCount + 1 ;
You can’t perform that action at this time.
0 commit comments