Make WordPress Core

Changeset 41932


Ignore:
Timestamp:
10/18/2017 11:05:02 PM (9 years ago)
Author:
westonruter
Message:

Customize: Draw attention to save button after collapsing the publish settings section when the changeset status or date had been changed.

Props bpayton, westonruter.
See #42114, #39896.
Fixes #42211.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r41930 r41932  
    68906890                // Set up publish settings section and its controls.
    68916891                api.section( 'publish_settings', function( section ) {
    6892                         var updateButtonsState, trashControl, updateSectionActive, isSectionActive, statusControl, dateControl, toggleDateControl, publishWhenTime, pollInterval, updateTimeArrivedPoller, timeArrivedPollingInterval = 1000;
     6892                        var updateButtonsState, trashControl, updateSectionActive, isSectionActive, statusControl, dateControl, toggleDateControl, publishWhenTime, pollInterval, updateTimeArrivedPoller, cancelScheduleButtonReminder, timeArrivedPollingInterval = 1000;
    68936893
    68946894                        trashControl = new api.Control( 'trash_changeset', {
    … …  
    69526952                        section.active.bind( updateButtonsState );
    69536953
     6954                        function highlightScheduleButton() {
     6955                                if ( ! cancelScheduleButtonReminder ) {
     6956                                        cancelScheduleButtonReminder = api.utils.highlightButton( btnWrapper, {
     6957                                                delay: 1000,
     6958
     6959                                                // Only abort the reminder when the save button is focused.
     6960                                                // If the user clicks the settings button to toggle the
     6961                                                // settings closed, we'll still remind them.
     6962                                                focusTarget: saveBtn
     6963                                        } );
     6964                                }
     6965                        }
     6966                        function cancelHighlightScheduleButton() {
     6967                                if ( cancelScheduleButtonReminder ) {
     6968                                        cancelScheduleButtonReminder();
     6969                                        cancelScheduleButtonReminder = null;
     6970                                }
     6971                        }
     6972                        api.state( 'selectedChangesetStatus' ).bind( cancelHighlightScheduleButton );
     6973
    69546974                        section.contentContainer.find( '.customize-action' ).text( api.l10n.updating );
    69556975                        section.contentContainer.find( '.customize-section-back' ).removeAttr( 'tabindex' );
    … …  
    69646984                                publishSettingsBtn.attr( 'aria-expanded', String( isExpanded ) );
    69656985                                publishSettingsBtn.toggleClass( 'active', isExpanded );
     6986
     6987                                if ( isExpanded ) {
     6988                                        cancelHighlightScheduleButton();
     6989                                } else if ( api.state( 'selectedChangesetStatus' ).get() !== api.state( 'changesetStatus' ).get() ) {
     6990                                        highlightScheduleButton();
     6991                                } else if ( 'future' === api.state( 'selectedChangesetStatus' ).get() && api.state( 'selectedChangesetDate' ).get() !== api.state( 'changesetDate' ).get() ) {
     6992                                        highlightScheduleButton();
     6993                                }
    69666994                        } );
    69676995
    … …  
    76217649                                var canSave;
    76227650
    7623                                 btnWrapper.removeClass( 'button-see-me' );
    7624 
    76257651                                if ( ! activated() ) {
    76267652                                        saveBtn.val( api.l10n.activate );
    … …  
    76467672                                                        if ( changesetDate.get() !== selectedChangesetDate.get() ) {
    76477673                                                                saveBtn.val( api.l10n.schedule );
    7648                                                                 btnWrapper.addClass( 'button-see-me' );
    76497674                                                        } else {
    76507675                                                                saveBtn.val( api.l10n.scheduled );
    76517676                                                        }
    76527677                                                } else {
    7653                                                         btnWrapper.addClass( 'button-see-me' );
    76547678                                                        saveBtn.val( api.l10n.schedule );
    76557679                                                }
Note: See TracChangeset for help on using the changeset viewer.