From ed35e2a826ce6ef8821ecc128ab9e2037b5ecec1 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 12 Mar 2008 19:56:08 +0000 Subject: [PATCH] Don't double insert widget. Props mdawaffe. fixes #6191 git-svn-id: https://develop.svn.wordpress.org/trunk@7267 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/widgets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js index 6bf7f2c899..6a6fc48cd1 100644 --- a/wp-admin/js/widgets.js +++ b/wp-admin/js/widgets.js @@ -104,8 +104,8 @@ jQuery(function($) { $('a.widget-control-remove', context).click( function() { var w = $(this).parents('li:first').find('input[@name^="widget-id"]').val(); $(this).parents('li:first').remove(); - var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); - t.parent().html( t.text() ).parents('li.widget-list-item:first').children( 'h4' ).children('a.widget-action') + var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); // will be empty for multi-widgets + 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 ); var n = parseInt( $('#widget-count').text(), 10 ) - 1; $('#widget-count').text( n.toString() )