Customize: Verify availability of history.replaceState
(in IE9) before attempting to populate changeset_uuid
parameter.
Props westonruter, timmydcrawford for testing. Amends [39686]. See #39227. Fixes #40405. git-svn-id: https://develop.svn.wordpress.org/trunk@40405 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1abf42b45e
commit
1b9c964e81
@ -4762,6 +4762,12 @@
|
|||||||
*/
|
*/
|
||||||
populateChangesetUuidParam = function( isIncluded ) {
|
populateChangesetUuidParam = function( isIncluded ) {
|
||||||
var urlParser, queryParams;
|
var urlParser, queryParams;
|
||||||
|
|
||||||
|
// Abort on IE9 which doesn't support history management.
|
||||||
|
if ( ! history.replaceState ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
urlParser = document.createElement( 'a' );
|
urlParser = document.createElement( 'a' );
|
||||||
urlParser.href = location.href;
|
urlParser.href = location.href;
|
||||||
queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
|
queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
|
||||||
@ -4780,11 +4786,9 @@
|
|||||||
history.replaceState( {}, document.title, urlParser.href );
|
history.replaceState( {}, document.title, urlParser.href );
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( history.replaceState ) {
|
|
||||||
changesetStatus.bind( function( newStatus ) {
|
changesetStatus.bind( function( newStatus ) {
|
||||||
populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus );
|
populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus );
|
||||||
} );
|
} );
|
||||||
}
|
|
||||||
|
|
||||||
// Expose states to the API.
|
// Expose states to the API.
|
||||||
api.state = state;
|
api.state = state;
|
||||||
|
Loading…
Reference in New Issue
Block a user