Revisions: Disable URL updating if a browser doesn't support the History API. Like IE < 10.

props markjaquith. see #24736.

git-svn-id: https://develop.svn.wordpress.org/trunk@24689 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2013-07-12 20:51:10 +00:00
parent 3e1cafce65
commit 8336111b52

View File

@ -12,7 +12,7 @@ window.wp = window.wp || {};
revisions.debug = true;
revisions.log = function() {
if ( revisions.debug )
if ( window.console && revisions.debug )
console.log.apply( console, arguments );
};
@ -342,9 +342,11 @@ window.wp = window.wp || {};
properties.baseUrl = revisions.settings.baseUrl;
this.set( properties );
// Start the router
this.router = new revisions.Router({ model: this });
Backbone.history.start({ pushState: true });
// Start the router if browser supports History API
if ( window.history && window.history.pushState ) {
this.router = new revisions.Router({ model: this });
Backbone.history.start({ pushState: true });
}
},
updateLoadingStatus: function() {