Make WordPress Core

Changeset 22442


Ignore:
Timestamp:
11/07/2012 09:31:08 PM (12 years ago)
Author:
westi
Message:

Post UI: Provide visual feedback to the user if they try to set an invalid date for a post. Fixes #17180 props jkudish.

File:
1 edited

Legend:

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

    r22268 r22442  
    388388
    389389        function updateText() {
     390
     391            if ( ! $('#timestampdiv').length )
     392                return true;
     393
    390394            var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
    391395                optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(),
     
    535539        });
    536540
     541        $('#post').on( 'submit', function(e){
     542            if ( ! updateText() ) {
     543                e.preventDefault();
     544                $('#timestampdiv').show();
     545                $('#publishing-action .spinner').hide();
     546                $('#publish').prop('disabled', false).removeClass('button-primary-disabled');
     547                return false;
     548            }
     549        });
     550
    537551        $('#post-status-select').siblings('a.edit-post-status').click(function() {
    538552            if ($('#post-status-select').is(":hidden")) {
Note: See TracChangeset for help on using the changeset viewer.