Post UI: Provide visual feedback to the user if they try to set an invalid date for a post. Fixes #17180 props jkudish.
git-svn-id: http://core.svn.wordpress.org/trunk@22442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a79310d45c
commit
5c72b7344b
|
@ -387,6 +387,10 @@ jQuery(document).ready( function($) {
|
|||
}
|
||||
|
||||
function updateText() {
|
||||
|
||||
if ( ! $('#timestampdiv').length )
|
||||
return true;
|
||||
|
||||
var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
|
||||
optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(),
|
||||
mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
|
||||
|
@ -534,6 +538,16 @@ jQuery(document).ready( function($) {
|
|||
return false;
|
||||
});
|
||||
|
||||
$('#post').on( 'submit', function(e){
|
||||
if ( ! updateText() ) {
|
||||
e.preventDefault();
|
||||
$('#timestampdiv').show();
|
||||
$('#publishing-action .spinner').hide();
|
||||
$('#publish').prop('disabled', false).removeClass('button-primary-disabled');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#post-status-select').siblings('a.edit-post-status').click(function() {
|
||||
if ($('#post-status-select').is(":hidden")) {
|
||||
$('#post-status-select').slideDown('fast');
|
||||
|
|
Loading…
Reference in New Issue