Widgets: highlight all drop zones (open and closed sidebars) on starting to drag a widget to indicate "droppability", fixes #26168.
git-svn-id: https://develop.svn.wordpress.org/trunk@26474 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
81557ba37c
commit
28da4145a6
@ -10082,7 +10082,6 @@ input.newtag:focus ~ div.taghint {
|
|||||||
|
|
||||||
.widget.ui-sortable-helper {
|
.widget.ui-sortable-helper {
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
z-index: 2000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-placeholder {
|
.widget-placeholder {
|
||||||
@ -10293,10 +10292,9 @@ div#widgets-right .closed .widgets-sortables {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Dragging a widget over a closed sidebar */
|
/* 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;
|
border-color: #777;
|
||||||
box-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
box-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
||||||
opacity: 0.6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Accessibility Mode */
|
/* Accessibility Mode */
|
||||||
|
@ -117,7 +117,7 @@ wpWidgets = {
|
|||||||
distance: 2,
|
distance: 2,
|
||||||
containment: 'document',
|
containment: 'document',
|
||||||
start: function( event, ui ) {
|
start: function( event, ui ) {
|
||||||
var $this = $(this),
|
var height, $this = $(this),
|
||||||
$wrap = $this.parent(),
|
$wrap = $this.parent(),
|
||||||
inside = ui.item.children('.widget-inside');
|
inside = ui.item.children('.widget-inside');
|
||||||
|
|
||||||
@ -126,15 +126,11 @@ wpWidgets = {
|
|||||||
$(this).sortable('refreshPositions');
|
$(this).sortable('refreshPositions');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $wrap.hasClass('closed') ) {
|
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 {
|
|
||||||
// Lock all open sidebars min-height when starting to drag.
|
// 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.
|
// Prevents jumping when dragging a widget from an open sidebar to a closed sidebar below.
|
||||||
$wrap.css( 'min-height', $wrap.height() + 'px' );
|
height = ui.item.hasClass('ui-draggable') ? $this.height() : 1 + $this.height();
|
||||||
$this.css( 'min-height', $this.height() - 2 + 'px' );
|
$this.css( 'min-height', height + 'px' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -152,7 +148,7 @@ wpWidgets = {
|
|||||||
addNew = $widget.find('input.add_new').val();
|
addNew = $widget.find('input.add_new').val();
|
||||||
widgetNumber = $widget.find('input.multi_number').val();
|
widgetNumber = $widget.find('input.multi_number').val();
|
||||||
|
|
||||||
$widget.attr( 'style', '' );
|
$widget.attr( 'style', '' ).removeClass('ui-draggable');
|
||||||
the_id = '';
|
the_id = '';
|
||||||
|
|
||||||
if ( addNew ) {
|
if ( addNew ) {
|
||||||
@ -179,7 +175,7 @@ wpWidgets = {
|
|||||||
$sidebar = $widget.parent();
|
$sidebar = $widget.parent();
|
||||||
|
|
||||||
if ( $sidebar.parent().hasClass('closed') ) {
|
if ( $sidebar.parent().hasClass('closed') ) {
|
||||||
$sidebar.parent().removeClass('widget-hover closed jump-open');
|
$sidebar.parent().removeClass('closed');
|
||||||
$children = $sidebar.children('.widget');
|
$children = $sidebar.children('.widget');
|
||||||
|
|
||||||
// Make sure the dropped widget is at the top
|
// Make sure the dropped widget is at the top
|
||||||
@ -200,21 +196,13 @@ wpWidgets = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
over: function() {
|
activate: function() {
|
||||||
var $wrap = $(this).parent();
|
$(this).parent().addClass( 'widget-hover' );
|
||||||
|
|
||||||
if ( $wrap.hasClass('closed') ) {
|
|
||||||
$wrap.addClass('widget-hover');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
out: function() {
|
|
||||||
$(this).parent().removeClass('widget-hover');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deactivate: function() {
|
deactivate: function() {
|
||||||
// Remove all min-height added on "start"
|
// 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 ) {
|
receive: function( event, ui ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user