diff --git a/src/wp-admin/css/wp-admin.css b/src/wp-admin/css/wp-admin.css index 327abd4bb6..c57149a5b9 100644 --- a/src/wp-admin/css/wp-admin.css +++ b/src/wp-admin/css/wp-admin.css @@ -10082,7 +10082,6 @@ input.newtag:focus ~ div.taghint { .widget.ui-sortable-helper { opacity: 0.8; - z-index: 2000; } .widget-placeholder { @@ -10293,11 +10292,10 @@ div#widgets-right .closed .widgets-sortables { } /* Dragging a widget over a closed sidebar */ -#widgets-right .widgets-holder-wrap.closed.widget-hover { +#widgets-right .widgets-holder-wrap.widget-hover { border-color: #777; box-shadow: 0 1px 2px rgba(0,0,0,0.3); - opacity: 0.6; -} +} /* Accessibility Mode */ .widgets_access #widgets-left .widget .widget-top { diff --git a/src/wp-admin/js/widgets.js b/src/wp-admin/js/widgets.js index 9d658ecdc4..f814714a6a 100644 --- a/src/wp-admin/js/widgets.js +++ b/src/wp-admin/js/widgets.js @@ -117,7 +117,7 @@ wpWidgets = { distance: 2, containment: 'document', start: function( event, ui ) { - var $this = $(this), + var height, $this = $(this), $wrap = $this.parent(), inside = ui.item.children('.widget-inside'); @@ -126,15 +126,11 @@ wpWidgets = { $(this).sortable('refreshPositions'); } - if ( $wrap.hasClass('closed') ) { - // There is a bug in UI Sortable that prevents firing of "over" when dragging a connected Draggable. - // This won't be needed when the bug is fixed. - $wrap.addClass('widget-hover'); - } else { + if ( ! $wrap.hasClass('closed') ) { // Lock all open sidebars min-height when starting to drag. // Prevents jumping when dragging a widget from an open sidebar to a closed sidebar below. - $wrap.css( 'min-height', $wrap.height() + 'px' ); - $this.css( 'min-height', $this.height() - 2 + 'px' ); + height = ui.item.hasClass('ui-draggable') ? $this.height() : 1 + $this.height(); + $this.css( 'min-height', height + 'px' ); } }, @@ -152,7 +148,7 @@ wpWidgets = { addNew = $widget.find('input.add_new').val(); widgetNumber = $widget.find('input.multi_number').val(); - $widget.attr( 'style', '' ); + $widget.attr( 'style', '' ).removeClass('ui-draggable'); the_id = ''; if ( addNew ) { @@ -179,7 +175,7 @@ wpWidgets = { $sidebar = $widget.parent(); if ( $sidebar.parent().hasClass('closed') ) { - $sidebar.parent().removeClass('widget-hover closed jump-open'); + $sidebar.parent().removeClass('closed'); $children = $sidebar.children('.widget'); // Make sure the dropped widget is at the top @@ -200,21 +196,13 @@ wpWidgets = { } }, - over: function() { - var $wrap = $(this).parent(); - - if ( $wrap.hasClass('closed') ) { - $wrap.addClass('widget-hover'); - } - }, - - out: function() { - $(this).parent().removeClass('widget-hover'); + activate: function() { + $(this).parent().addClass( 'widget-hover' ); }, deactivate: function() { // Remove all min-height added on "start" - $(this).css( 'min-height', '' ).parent().css( 'min-height', '' ); + $(this).css( 'min-height', '' ).parent().removeClass( 'widget-hover' ); }, receive: function( event, ui ) {