Skip to content
Permalink
Browse files

Draggable: Style updates

Ref #14246
Ref gh-1588
  • Loading branch information
arschmitz committed Aug 21, 2015
1 parent f43311d commit f75c8761cb7d4e6fca39c4b7cedf2442a8bc260a
Showing with 19 additions and 19 deletions.
  1. +1 −1 tests/unit/draggable/common.js
  2. +6 −6 tests/unit/draggable/core.js
  3. +6 −6 tests/unit/draggable/options.js
  4. +6 −6 ui/widgets/draggable.js
@@ -37,7 +37,7 @@ common.testWidget( "draggable", {
distance: 1,
iframeFix: false,

// callbacks
// Callbacks
create: null,
drag: null,
start: null,
@@ -67,11 +67,11 @@ test( "resizable handle with complex markup (#8756 / #8757)", function() {
var handle = $(".ui-resizable-w div"),
target = $( "#draggable1" ).draggable().resizable({ handles: "all" });

// todo: fix resizable so it doesn't require a mouseover
// Todo: fix resizable so it doesn't require a mouseover
handle.simulate("mouseover").simulate( "drag", { dx: -50 } );
equal( target.width(), 250, "compare width" );

// todo: fix resizable so it doesn't require a mouseover
// Todo: fix resizable so it doesn't require a mouseover
handle.simulate("mouseover").simulate( "drag", { dx: 50 } );
equal( target.width(), 200, "compare width" );
});
@@ -215,7 +215,7 @@ test( "scroll offset with fixed ancestors", function() {
$( [ "hidden", "auto", "scroll" ] ).each(function() {
var overflow = this;

// http://bugs.jqueryui.com/ticket/9379 - position bug in scrollable div
// Http://bugs.jqueryui.com/ticket/9379 - position bug in scrollable div
// http://bugs.jqueryui.com/ticket/10147 - Wrong position in a parent with "overflow: hidden"
test( "position in scrollable parent with overflow: " + overflow, function() {
expect( 2 );
@@ -230,7 +230,7 @@ $( [ "hidden", "auto", "scroll" ] ).each(function() {
dragDelta = 20,
delta = 100,

// we scroll after each drag event, so subtract 1 from number of moves for expected
// We scroll after each drag event, so subtract 1 from number of moves for expected
expected = delta + ( ( moves - 1 ) * dragDelta ),
element = $( "#dragged" ).draggable({
drag: function() {
@@ -300,13 +300,13 @@ asyncTest( "blur behavior", function() {

testHelper.move( focusElement, 1, 1 );

// http://bugs.jqueryui.com/ticket/10527
// Http://bugs.jqueryui.com/ticket/10527
// Draggable: Can't select option in modal dialog (IE8)
strictEqual( document.activeElement, focusElement.get( 0 ), "test element is focused after mousing down on itself" );

testHelper.move( element, 50, 50 );

// http://bugs.jqueryui.com/ticket/4261
// Http://bugs.jqueryui.com/ticket/4261
// active element should blur when mousing down on a draggable
notStrictEqual( document.activeElement, focusElement.get( 0 ), "test element is no longer focused after mousing down on a draggable" );
start();
@@ -278,12 +278,12 @@ test( "connectToSortable, dragging out of a sortable", function() {
// Position issue when connected to sortable
deepEqual( ui.helper.offset(), offsetExpected, "draggable offset is correct" );

// http://bugs.jqueryui.com/ticket/7734
// Http://bugs.jqueryui.com/ticket/7734
// HTML IDs are removed when dragging to a Sortable
equal( sortItem[ 0 ], dragHelper[ 0 ], "both have the same helper" );
equal( sortItem.attr( "id" ), dragHelper.attr( "id" ), "both have the same id" );

// http://bugs.jqueryui.com/ticket/9481
// Http://bugs.jqueryui.com/ticket/9481
// connectToSortable causes sortable revert to fail on second attempt
equal( sortable.sortable( "option", "revert" ), 100, "sortable revert behavior is preserved" );
});
@@ -357,7 +357,7 @@ test( "connectToSortable, dragging multiple elements in and out of sortable", fu
moves: 10
});

// http://bugs.jqueryui.com/ticket/9675
// Http://bugs.jqueryui.com/ticket/9675
// Animation issue with revert and connectToSortable
sortable.one( "sortstop", function( event, ui ) {
ok( !$.contains( document, ui.placeholder[ 0 ] ), "placeholder was removed" );
@@ -419,7 +419,7 @@ test( "connectToSortable, dragging through a sortable", function() {
sortable = $( "#sortable2" ).sortable(),
sortableOffset = sortable.offset();

// http://bugs.jqueryui.com/ticket/10669
// Http://bugs.jqueryui.com/ticket/10669
// Draggable: Position issue with connectToSortable
draggable.one( "dragstop", function() {
equal( draggable.parent().attr( "id" ), "sortable", "restored draggable to original parent" );
@@ -1022,7 +1022,7 @@ asyncTest( "revert and revertDuration", function() {
}
});

// animation are async, so test for it asynchronously
// Animation are async, so test for it asynchronously
testHelper.move( element, 50, 50 );
setTimeout( function() {
ok( $( "#draggable2" ).is( ":animated" ), "revert: true with revertDuration should animate" );
@@ -1191,7 +1191,7 @@ test( "snap, snapMode, and snapTolerance", function( assert ) {
}),
element2 = $( "#draggable2" ).draggable();

// http://bugs.jqueryui.com/ticket/9724
// Http://bugs.jqueryui.com/ticket/9724
// Draggable: Snapping coordinates thrown off by margin on draggable
element.css( "margin", "3px" );

@@ -65,7 +65,7 @@ $.widget("ui.draggable", $.ui.mouse, {
stack: false,
zIndex: false,

// callbacks
// Callbacks
drag: null,
start: null,
stop: null
@@ -108,7 +108,7 @@ $.widget("ui.draggable", $.ui.mouse, {

this._blurActiveElement( event );

// among others, prevent a drag on a resizable-handle
// Among others, prevent a drag on a resizable-handle
if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
return false;
}
@@ -362,7 +362,7 @@ $.widget("ui.draggable", $.ui.mouse, {
helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
}

// http://bugs.jqueryui.com/ticket/9446
// Http://bugs.jqueryui.com/ticket/9446
// a helper function can return the original element
// which wouldn't have been set to relative in _create
if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
@@ -700,7 +700,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
if ( sortable && !sortable.options.disabled ) {
draggable.sortables.push( sortable );

// refreshPositions is called at drag start to refresh the containerCache
// RefreshPositions is called at drag start to refresh the containerCache
// which is used in drag. This ensures it's initialized and synchronized
// with any changes that might have happened on the page since initialization.
sortable.refreshPositions();
@@ -825,7 +825,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
this.refreshPositions();
});

// hack so receive/update callbacks work (mostly)
// Hack so receive/update callbacks work (mostly)
draggable.currentItem = draggable.element;
sortable.fromOutside = draggable;
}
@@ -854,7 +854,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
sortable._trigger( "out", event, sortable._uiHash( sortable ) );
sortable._mouseStop( event, true );

// restore sortable behaviors that were modfied
// Restore sortable behaviors that were modfied
// when the draggable entered the sortable area (#9481)
sortable.options.revert = sortable.options._revert;
sortable.options.helper = sortable.options._helper;

0 comments on commit f75c876

Please sign in to comment.
You can’t perform that action at this time.