mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-11 08:04:32 +00:00
JavaScript: when starting Backbone history, stop if previously started.
Prevent a potential error condition if Backbone history is started by a plugin or theme before core tries to start it. Props tfrommen. Fixes #39612. git-svn-id: https://develop.svn.wordpress.org/trunk@40076 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -844,6 +844,9 @@ Manage = MediaFrame.extend({
|
||||
startHistory: function() {
|
||||
// Verify pushState support and activate
|
||||
if ( window.history && window.history.pushState ) {
|
||||
if ( Backbone.History.started ) {
|
||||
Backbone.history.stop();
|
||||
}
|
||||
Backbone.history.start( {
|
||||
root: window._wpMediaGridSettings.adminUrl,
|
||||
pushState: true
|
||||
|
||||
@@ -259,6 +259,9 @@ Manage = MediaFrame.extend({
|
||||
startHistory: function() {
|
||||
// Verify pushState support and activate
|
||||
if ( window.history && window.history.pushState ) {
|
||||
if ( Backbone.History.started ) {
|
||||
Backbone.history.stop();
|
||||
}
|
||||
Backbone.history.start( {
|
||||
root: window._wpMediaGridSettings.adminUrl,
|
||||
pushState: true
|
||||
|
||||
Reference in New Issue
Block a user