Changeset 6571

Show
Ignore:
Timestamp:
01/07/08 23:55:49 (6 months ago)
Author:
ryan
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/js/widgets.js

    r6556 r6571  
    103103    $('a.widget-control-add').click( addClick ); 
    104104 
     105    var widgetSortable; 
     106    var widgetSortableInit = function() { 
     107        try { // a hack to make sortables work in jQuery 1.2+ and IE7 
     108            $('#current-sidebar .widget-control-list').SortableDestroy(); 
     109        } catch(e) {} 
     110        widgetSortable = $('#current-sidebar .widget-control-list').Sortable( { 
     111            accept: 'widget-sortable', 
     112            helperclass: 'sorthelper', 
     113            handle: 'h4.widget-title', 
     114            onStop: widgetSortableInit 
     115        } ); 
     116    } 
     117 
    105118    // initialize sortable 
    106     var widgetSortable = $('#current-sidebar .widget-control-list').Sortable( { 
    107         accept: 'widget-sortable', 
    108         helperclass: 'sorthelper', 
    109         handle: 'h4.widget-title' 
    110     } ); 
     119    widgetSortableInit(); 
    111120 
    112121});