File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -1339,8 +1339,9 @@ function initDiffEditor(editorId) {
13391339
13401340 const download = wrapper . find ( ".download" ) [ 0 ] ;
13411341 const edit = wrapper . find ( ".edit" ) [ 0 ] ;
1342- const updateTabRank = ( rank ) => {
1343- if ( rank !== undefined ) {
1342+ wrapper . find ( ".nav" ) . on ( 'show.bs.tab' , ( e ) => {
1343+ if ( e . target . dataset . rank . length > 0 ) {
1344+ const rank = parseInt ( e . target . dataset . rank ) ;
13441345 let url = new URL ( download . href ) ;
13451346 url . searchParams . set ( "fetch" , rank ) ;
13461347 enableButton ( download , url ) ;
@@ -1352,14 +1353,6 @@ function initDiffEditor(editorId) {
13521353 disableButton ( download ) ;
13531354 disableButton ( edit ) ;
13541355 }
1355- } ;
1356- wrapper . find ( ".nav" ) . on ( 'show.bs.tab' , ( e ) => {
1357- if ( e . target . dataset . rank . length > 0 ) {
1358- const rank = parseInt ( e . target . dataset . rank ) ;
1359- updateTabRank ( rank ) ;
1360- } else {
1361- updateTabRank ( undefined ) ;
1362- }
13631356 } )
13641357
13651358 const diffTitle = document . getElementById ( `${ editorId } -title-diff` ) ;
You can’t perform that action at this time.
0 commit comments