Fix edit link form categories a bit. AJAX add still needs work.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-02-02 20:31:56 +00:00
parent d42b1a8256
commit 45ebbd5bb8
7 changed files with 33 additions and 15 deletions

View File

@@ -8,8 +8,6 @@ addLoadEvent( function() {
// Ajax Cat
var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } );
jQuery('#category-add-sumbit').click( function() { newCat.focus(); } );
var newCatParent = false;
var newCatParentOption = false;
var noSyncChecks = false; // prophylactic. necessary?
var syncChecks = function() {
if ( noSyncChecks )
@@ -22,8 +20,6 @@ addLoadEvent( function() {
noSyncChecks = false;
};
var catAddAfter = function( r, s ) {
if ( !newCatParent ) newCatParent = jQuery('#newcat_parent');
if ( !newCatParentOption ) newCatParentOption = newCatParent.find( 'option[value=-1]' );
jQuery(s.what + ' response_data', r).each( function() {
var t = jQuery(jQuery(this).text());
t.find( 'label' ).each( function() {
@@ -31,13 +27,9 @@ addLoadEvent( function() {
var val = th.find('input').val();
var id = th.find('input')[0].id
jQuery('#' + id).change( syncChecks );
if ( newCatParent.find( 'option[value=' + val + ']' ).size() )
return;
var name = jQuery.trim( th.text() );
var o = jQuery( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
newCatParent.prepend( o );
} );
newCatParentOption.attr( 'selected', true );
} );
};
jQuery('#categorychecklist').wpList( {

View File

@@ -5,7 +5,7 @@ function add_postbox_toggles() {
function save_postboxes_state() {
var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(',');
jQuery.post(postL10n.requestFile, {
jQuery.post(postboxL10n.requestFile, {
action: 'closed-postboxes',
closed: closed,
cookie: document.cookie});