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

props markjaquith. see #24736.

git-svn-id: http://core.svn.wordpress.org/trunk@24689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2013-07-12 20:51:10 +00:00
parent 0e4a817d15
commit 8a600bf8a5
1 changed files with 6 additions and 4 deletions

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() {