Ticket #50291: 50291.diff
File 50291.diff, 1.8 KB (added by , 5 years ago) |
---|
-
src/js/_enqueues/wp/theme.js
666 666 'click .delete-theme': 'deleteTheme', 667 667 'click .left': 'previousTheme', 668 668 'click .right': 'nextTheme', 669 'click #update-theme': 'updateTheme' 669 'click #update-theme': 'updateTheme', 670 'click .toggle-auto-update': 'autoupdateState' 670 671 }, 671 672 672 673 // The HTML template for the theme overlay. … … 787 788 this.trigger( 'theme:collapse' ); 788 789 }, 789 790 791 // Set state of the auto-update settings link after it has been changed and saved. 792 autoupdateState: function() { 793 var callback, 794 _this = this; 795 796 // Support concurrent clicks in different Theme Details overlays. 797 callback = function( event, data ) { 798 if ( _this.model.get( 'id' ) === data.asset ) { 799 _this.model.set( { autoupdate: data.state === 'enable' } ); 800 $( document ).off( 'wp-auto-update-setting-changed', callback ); 801 } 802 } 803 804 // Triggered in updates.js 805 $( document ).on( 'wp-auto-update-setting-changed', callback ); 806 }, 807 790 808 updateTheme: function( event ) { 791 809 var _this = this; 792 810 event.preventDefault(); -
src/js/_enqueues/wp/updates.js
2599 2599 $parent.find( '.auto-update-time' ).addClass( 'hidden' ); 2600 2600 wp.a11y.speak( wp.updates.l10n.autoUpdatesDisabled, 'polite' ); 2601 2601 } 2602 2603 $document.trigger( 'wp-auto-update-setting-changed', { state: action, type: type, asset: asset } ); 2602 2604 } ) 2603 2605 .fail( function() { 2604 2606 $parent.find( '.notice.error' ).removeClass( 'hidden' ).find( 'p' ).text( wp.updates.l10n.autoUpdatesError );