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

git-svn-id: http://svn.automattic.com/wordpress/trunk@18774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-09-25 18:53:34 +00:00
parent 1e145adb97
commit ce992634cc
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 ) {

File diff suppressed because one or more lines are too long

View File

@ -340,7 +340,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ), '20110414' );
$scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20110922', 1 );
$scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20110925', 1 );
$scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'thickbox' ), '20110118', 1 );