Make WordPress Core

Changeset 24689


Ignore:
Timestamp:
07/12/2013 08:51:10 PM (12 years ago)
Author:
ocean90
Message:

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

props markjaquith. see #24736.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/revisions.js

    r24686 r24689  
    1313
    1414    revisions.log = function() {
    15         if ( revisions.debug )
     15        if ( window.console && revisions.debug )
    1616            console.log.apply( console, arguments );
    1717    };
     
    343343            this.set( properties );
    344344
    345             // Start the router
    346             this.router = new revisions.Router({ model: this });
    347             Backbone.history.start({ pushState: true });
     345            // Start the router if browser supports History API
     346            if ( window.history && window.history.pushState ) {
     347                this.router = new revisions.Router({ model: this });
     348                Backbone.history.start({ pushState: true });
     349            }
    348350        },
    349351
Note: See TracChangeset for help on using the changeset viewer.