Make WordPress Core

Changeset 6571


Ignore:
Timestamp:
01/07/2008 11:55:49 PM (17 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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});
Note: See TracChangeset for help on using the changeset viewer.