mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02:00
Don't block the Publish button after adding new category, fixes #9174
git-svn-id: http://svn.automattic.com/wordpress/trunk@10596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2869882861
commit
693beba4aa
@ -210,7 +210,7 @@ var commentsBox, tagCloud;
|
|||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
jQuery(document).ready( function($) {
|
jQuery(document).ready( function($) {
|
||||||
var categoryTabs, newCat, newCatParent = false, newCatParentOption = false, noSyncChecks = false, syncChecks, catAddAfter, dotabkey = true, stamp = $('#timestamp').html(), visibility = $('#post-visibility-display').html(), sticky = '';
|
var categoryTabs, noSyncChecks = false, syncChecks, catAddAfter, dotabkey = true, stamp = $('#timestamp').html(), visibility = $('#post-visibility-display').html(), sticky = '';
|
||||||
|
|
||||||
// for Press This
|
// for Press This
|
||||||
if ( typeof autosave != 'function' )
|
if ( typeof autosave != 'function' )
|
||||||
@ -237,8 +237,8 @@ jQuery(document).ready( function($) {
|
|||||||
categoryTabs =jQuery('#category-tabs').tabs();
|
categoryTabs =jQuery('#category-tabs').tabs();
|
||||||
|
|
||||||
// Ajax Cat
|
// Ajax Cat
|
||||||
newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
|
$('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
|
||||||
$('#category-add-sumbit').click( function() { newCat.focus(); } );
|
$('#category-add-sumbit').click( function() { $('#newcat').focus(); } );
|
||||||
|
|
||||||
syncChecks = function() {
|
syncChecks = function() {
|
||||||
if ( noSyncChecks )
|
if ( noSyncChecks )
|
||||||
@ -256,20 +256,19 @@ jQuery(document).ready( function($) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
catAddAfter = function( r, s ) {
|
catAddAfter = function( r, s ) {
|
||||||
if ( !newCatParent ) newCatParent = jQuery('#newcat_parent');
|
var newCatParent = jQuery('#newcat_parent'), newCatParentOption = newCatParent.find( 'option[value="-1"]' );
|
||||||
if ( !newCatParentOption ) newCatParentOption = newCatParent.find( 'option[value=-1]' );
|
|
||||||
$(s.what + ' response_data', r).each( function() {
|
$(s.what + ' response_data', r).each( function() {
|
||||||
var t = $($(this).text());
|
var t = $($(this).text());
|
||||||
t.find( 'label' ).each( function() {
|
t.find( 'label' ).each( function() {
|
||||||
var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name, o;
|
var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name, o;
|
||||||
$('#' + id).change( syncChecks ).change();
|
$('#' + id).change( syncChecks ).change();
|
||||||
if ( newCatParent.find( 'option[value=' + val + ']' ).size() )
|
if ( newCatParent.find( 'option[value="' + val + '"]' ).size() )
|
||||||
return;
|
return;
|
||||||
name = $.trim( th.text() );
|
name = $.trim( th.text() );
|
||||||
o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
|
o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
|
||||||
newCatParent.prepend( o );
|
newCatParent.prepend( o );
|
||||||
} );
|
} );
|
||||||
newCatParentOption.attr( 'selected', true );
|
newCatParentOption.attr( 'selected', 'selected' );
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -281,10 +280,8 @@ jQuery(document).ready( function($) {
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
$('#category-add-toggle').click( function() {
|
$('#category-add-toggle').click( function() {
|
||||||
$(this).parents('div:first').toggleClass( 'wp-hidden-children' );
|
$('#category-adder').toggleClass( 'wp-hidden-children' );
|
||||||
// categoryTabs.tabs( 'select', '#categories-all' ); // this is broken (in the UI beta?)
|
categoryTabs.tabs( 'select', 0 );
|
||||||
categoryTabs.find( 'a[href="#categories-all"]' ).click();
|
|
||||||
$('#newcat').focus();
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -249,7 +249,7 @@ function wp_default_scripts( &$scripts ) {
|
|||||||
'l10n_print_after' => 'try{convertEntities(slugL10n);}catch(e){};'
|
'l10n_print_after' => 'try{convertEntities(slugL10n);}catch(e){};'
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20090201' );
|
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20090219' );
|
||||||
$scripts->add_data( 'post', 'group', 1 );
|
$scripts->add_data( 'post', 'group', 1 );
|
||||||
$scripts->localize( 'post', 'postL10n', array(
|
$scripts->localize( 'post', 'postL10n', array(
|
||||||
'tagsUsed' => __('Tags used on this post:'),
|
'tagsUsed' => __('Tags used on this post:'),
|
||||||
|
Loading…
Reference in New Issue
Block a user