Fix the workaround for UI Draggable to include single instance widgets (do they still exist?), see #17952

git-svn-id: https://develop.svn.wordpress.org/trunk@18774 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2011-09-25 18:53:34 +00:00
parent 10d60279b9
commit 8c8d048749
3 changed files with 5 additions and 5 deletions

View File

@@ -114,16 +114,16 @@ wpWidgets = {
var add = ui.item.find('input.add_new').val(),
n = ui.item.find('input.multi_number').val(),
id = ui.item.attr('id'),
id = the_id,
sb = $(this).attr('id');
ui.item.css({margin:'', 'width':''});
the_id = '';
if ( add ) {
if ( 'multi' == add ) {
ui.item.html( ui.item.html().replace(/<[^<>]+>/g, function(m){ return m.replace(/__i__|%i%/g, n); }) );
ui.item.attr( 'id', the_id.replace('__i__', n) );
the_id = '';
ui.item.attr( 'id', id.replace('__i__', n) );
n++;
$('div#' + id).find('input.multi_number').val(n);
} else if ( 'single' == add ) {