File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -468,22 +468,20 @@ const inject = {
468468
469469 _update_history ( cfg , trigger , title ) {
470470 // History support. if subform is submitted, append form params
471- const glue = cfg . url . indexOf ( "?" ) > - 1 ? "&" : "?" ;
472- if ( cfg . history === "record" && "pushState" in history ) {
473- if ( cfg . params ) {
474- history . pushState (
475- { url : cfg . url + glue + cfg . params } ,
476- "" ,
477- cfg . url + glue + cfg . params
478- ) ;
479- } else {
480- history . pushState ( { url : cfg . url } , "" , cfg . url ) ;
481- }
482- // Also inject title element if we have one
483- if ( title )
484- this . _inject ( trigger , title , $ ( "title" ) , {
485- action : "element" ,
486- } ) ;
471+ if ( cfg . history !== "record" || ! history ?. pushState ) {
472+ return ;
473+ }
474+ let url = cfg . url ;
475+ const glue = url . indexOf ( "?" ) > - 1 ? "&" : "?" ;
476+ if ( cfg . params ) {
477+ url = `${ url } ${ glue } ${ cfg . params } ` ;
478+ }
479+ history . pushState ( { url : url } , "" , url ) ;
480+ // Also inject title element if we have one
481+ if ( title ) {
482+ this . _inject ( trigger , title , $ ( "title" ) , {
483+ action : "element" ,
484+ } ) ;
487485 }
488486 } ,
489487
You can’t perform that action at this time.
0 commit comments