Plugins and Themes Auto-Updates: update the state of the auto-update link on the themes screen after successfully saving the setting.
Props desrosj, pbiron, azaozz. Fixes #50291. Built from https://develop.svn.wordpress.org/trunk@47883 git-svn-id: http://core.svn.wordpress.org/trunk@47657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
94be20e612
commit
0318a92948
|
@ -666,7 +666,8 @@ themes.view.Details = wp.Backbone.View.extend({
|
|||
'click .delete-theme': 'deleteTheme',
|
||||
'click .left': 'previousTheme',
|
||||
'click .right': 'nextTheme',
|
||||
'click #update-theme': 'updateTheme'
|
||||
'click #update-theme': 'updateTheme',
|
||||
'click .toggle-auto-update': 'autoupdateState'
|
||||
},
|
||||
|
||||
// The HTML template for the theme overlay.
|
||||
|
@ -787,6 +788,23 @@ themes.view.Details = wp.Backbone.View.extend({
|
|||
this.trigger( 'theme:collapse' );
|
||||
},
|
||||
|
||||
// Set state of the auto-update settings link after it has been changed and saved.
|
||||
autoupdateState: function() {
|
||||
var callback,
|
||||
_this = this;
|
||||
|
||||
// Support concurrent clicks in different Theme Details overlays.
|
||||
callback = function( event, data ) {
|
||||
if ( _this.model.get( 'id' ) === data.asset ) {
|
||||
_this.model.set( { autoupdate: 'enable' === data.state } );
|
||||
$( document ).off( 'wp-auto-update-setting-changed', callback );
|
||||
}
|
||||
}
|
||||
|
||||
// Triggered in updates.js
|
||||
$( document ).on( 'wp-auto-update-setting-changed', callback );
|
||||
},
|
||||
|
||||
updateTheme: function( event ) {
|
||||
var _this = this;
|
||||
event.preventDefault();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2599,6 +2599,8 @@
|
|||
$parent.find( '.auto-update-time' ).addClass( 'hidden' );
|
||||
wp.a11y.speak( wp.updates.l10n.autoUpdatesDisabled, 'polite' );
|
||||
}
|
||||
|
||||
$document.trigger( 'wp-auto-update-setting-changed', { state: action, type: type, asset: asset } );
|
||||
} )
|
||||
.fail( function() {
|
||||
$parent.find( '.notice.error' ).removeClass( 'hidden' ).find( 'p' ).text( wp.updates.l10n.autoUpdatesError );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.5-alpha-47882';
|
||||
$wp_version = '5.5-alpha-47883';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue