Ticket #16972: 16972.3.diff

File 16972.3.diff, 1.1 KB (added by lessbloat, 7 months ago)
  • wp-admin/js/postbox.js

     
    1010                        $('.postbox h3, .postbox .handlediv').bind('click.postboxes', function() { 
    1111                                var p = $(this).parent('.postbox'), id = p.attr('id'); 
    1212 
    13                                 if ( 'dashboard_browser_nag' == id ) 
     13                                if ( 'dashboard_browser_nag' == id || $(this).parent().hasClass('was-sorted') ) 
    1414                                        return; 
    1515 
    1616                                p.toggleClass('closed'); 
     
    7777                                distance: 2, 
    7878                                tolerance: 'pointer', 
    7979                                forcePlaceholderSize: true, 
    80                                 helper: 'clone', 
    8180                                opacity: 0.65, 
     81                                start: function (e,ui) { 
     82                                        $(ui.item[0]).addClass('was-sorted'); 
     83                                }, 
    8284                                stop: function(e,ui) { 
    8385                                        if ( $(this).find('#dashboard_browser_nag').is(':visible') && 'dashboard_browser_nag' != this.firstChild.id ) { 
    8486                                                $(this).sortable('cancel'); 
    8587                                                return; 
    8688                                        } 
     89                                         
     90                                        setTimeout(function () { 
     91                                                $(ui.item[0]).removeClass('was-sorted'); 
     92                                        }, 50); 
    8793 
    8894                                        postboxes.save_order(page); 
    8995                                },