File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
djangocms_versioning/static/djangocms_versioning/js Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,16 @@ function bindHandlers(submitButton) {
66}
77
88window . addEventListener ( 'load' , function ( ) {
9- document . querySelector ( 'select[name=action]' ) . addEventListener ( 'change' , function ( ) {
10- // Always set handlersBound to false when the select option changed
11- let handlersBound = false ;
12- let selectVal = this . options [ this . selectedIndex ] . getAttribute ( 'value' ) ;
13- const actionsForm = document . getElementById ( 'changelist-form' ) ;
14- const submitButton = actionsForm . querySelector ( '[type="submit"]' ) ;
9+ document . querySelector ( 'select[name=action]' ) . addEventListener ( 'change' , function ( ) {
10+ let selectVal = this . options [ this . selectedIndex ] . getAttribute ( "value" ) ;
11+ const actionsForm = document . getElementById ( 'changelist-form' )
12+ const submitButton = actionsForm . querySelector ( '[type="submit"]' )
1513
1614 if ( selectVal === 'compare_versions' ) {
1715 // Setting the target to blank to ensure the compare view is opened in a new tab
18- actionsForm . setAttribute ( 'target' , '_blank' ) ;
19- if ( handlersBound === false ) {
20- bindHandlers ( submitButton ) ;
21- handlersBound = true ;
22- }
23- } else {
16+ actionsForm . setAttribute ( 'target' , '_blank' ) ;
17+ bindHandlers ( submitButton ) ;
18+ } else {
2419 // If the user deselect the compare version action, the "target=_blank" is removed
2520 actionsForm . removeAttribute ( 'target' ) ;
2621 }
You can’t perform that action at this time.
0 commit comments