Make WordPress Core

Ticket #13524: 13524.3.patch

File 13524.3.patch, 1000 bytes (added by polevaultweb, 11 years ago)

Makes the hover delay related to the sortable events, not just mousehover

  • src/wp-admin/js/widgets.js

     
    113113                        }
    114114                });
    115115
     116                var widgetHoverTimeout;
     117
    116118                sidebars.sortable({
    117119                        placeholder: 'widget-placeholder',
    118120                        items: '> .widget',
     
    120122                        cursor: 'move',
    121123                        distance: 2,
    122124                        containment: 'document',
     125                        out : function( event, ui ) {
     126                                clearTimeout( widgetHoverTimeout );
     127                        },
    123128                        start: function( event, ui ) {
    124129                                var height, $this = $(this),
    125130                                        $wrap = $this.parent(),
     
    135140                                        // Prevents jumping when dragging a widget from an open sidebar to a closed sidebar below.
    136141                                        height = ui.item.hasClass('ui-draggable') ? $this.height() : 1 + $this.height();
    137142                                        $this.css( 'min-height', height + 'px' );
     143                                } else {
     144                                        widgetHoverTimeout = setTimeout( function() {
     145                                                $wrap.removeClass('closed');
     146                                        }, 300 );
    138147                                }
    139148                        },
    140149