Fix for widget sort with IE7. Props filosofo. see #5292 #5583

git-svn-id: http://svn.automattic.com/wordpress/trunk@6571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-01-07 23:55:49 +00:00
parent 62d4757979
commit 7c8824653d
1 changed files with 14 additions and 5 deletions

View File

@ -102,11 +102,20 @@ jQuery(function($) {
$('a.widget-control-add').click( addClick );
var widgetSortable;
var widgetSortableInit = function() {
try { // a hack to make sortables work in jQuery 1.2+ and IE7
$('#current-sidebar .widget-control-list').SortableDestroy();
} catch(e) {}
widgetSortable = $('#current-sidebar .widget-control-list').Sortable( {
accept: 'widget-sortable',
helperclass: 'sorthelper',
handle: 'h4.widget-title',
onStop: widgetSortableInit
} );
}
// initialize sortable
var widgetSortable = $('#current-sidebar .widget-control-list').Sortable( {
accept: 'widget-sortable',
helperclass: 'sorthelper',
handle: 'h4.widget-title'
} );
widgetSortableInit();
});