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() {
1465
1465
}
1466
1466
1467
1467
function handleDocumentTypeSelect ( ) {
1468
- $ ( "body" ) . on ( "click" , ".document_type_select" , function ( ) {
1468
+ $ ( "body" ) . on ( "click" , ".document_type_select" , function ( e ) {
1469
+ e . preventDefault ( ) ;
1469
1470
$match_pattern = $ ( this )
1470
1471
. parents ( ".document_type_dropdown" )
1471
1472
. data ( "match-pattern" ) ;
@@ -1646,6 +1647,8 @@ function postDocumentTypePatterns(
1646
1647
return ;
1647
1648
}
1648
1649
1650
+ const scrollPosition = window . scrollY ;
1651
+
1649
1652
$ . ajax ( {
1650
1653
url : "/api/document-type-patterns/" ,
1651
1654
type : "POST" ,
@@ -1657,7 +1660,9 @@ function postDocumentTypePatterns(
1657
1660
csrfmiddlewaretoken : csrftoken ,
1658
1661
} ,
1659
1662
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 ) ;
1661
1666
$ ( "#document_type_patterns_table" ) . DataTable ( ) . ajax . reload ( null , false ) ;
1662
1667
if ( currentTab === "" ) { //Only add a notification if we are on the first tab
1663
1668
newDocumentTypePatternsCount = newDocumentTypePatternsCount + 1 ;
You can’t perform that action at this time.
0 commit comments