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

git-svn-id: https://develop.svn.wordpress.org/trunk@6571 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-01-07 23:55:49 +00:00
parent 5daadf8ce7
commit e90247fe6d
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();
});