Don't double insert widget. Props mdawaffe. fixes #6191

git-svn-id: https://develop.svn.wordpress.org/trunk@7267 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-12 19:56:08 +00:00
parent 65a8975cc0
commit ed35e2a826
1 changed files with 2 additions and 2 deletions

View File

@ -104,8 +104,8 @@ jQuery(function($) {
$('a.widget-control-remove', context).click( function() { $('a.widget-control-remove', context).click( function() {
var w = $(this).parents('li:first').find('input[@name^="widget-id"]').val(); var w = $(this).parents('li:first').find('input[@name^="widget-id"]').val();
$(this).parents('li:first').remove(); $(this).parents('li:first').remove();
var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); // will be empty for multi-widgets
t.parent().html( t.text() ).parents('li.widget-list-item:first').children( 'h4' ).children('a.widget-action') t.parents('.widget-control-info:first').html( t.text() ).parents('li.widget-list-item:first').children( 'h4' ).children('a.widget-action')
.show().text( widgetsL10n.add ).unbind().click( addClick ); .show().text( widgetsL10n.add ).unbind().click( addClick );
var n = parseInt( $('#widget-count').text(), 10 ) - 1; var n = parseInt( $('#widget-count').text(), 10 ) - 1;
$('#widget-count').text( n.toString() ) $('#widget-count').text( n.toString() )