Skip to content

Commit ce94981

Browse files
committed
Draggable: Remove core event/alias and deprecated module dependencies
1 parent be0a176 commit ce94981

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tests/unit/draggable/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ test( "Stray mousemove after mousedown still drags", function() {
116116
// In IE8, when content is placed under the mouse (e.g. when draggable content is replaced
117117
// on mousedown), mousemove is triggered on those elements even though the mouse hasn't moved.
118118
// Support: IE <9
119-
element.bind( "mousedown", function() {
119+
element.on( "mousedown", function() {
120120
$( document ).simulate( "mousemove", { button: -1 });
121121
});
122122

tests/unit/draggable/helper.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ return $.extend( helper, {
8484
element = $( el ),
8585
beginOffset = element.offset();
8686

87-
element.bind( "dragstop", function() {
87+
element.on( "dragstop", function() {
8888
ok( false, "should not drag " + msg );
8989
});
9090

@@ -100,7 +100,7 @@ return $.extend( helper, {
100100
equal( newOffset.left, beginOffset.left, "Offset left should not be different" );
101101
equal( newOffset.top, beginOffset.top, "Offset top should not be different" );
102102

103-
element.unbind( "dragstop" );
103+
element.off( "dragstop" );
104104
},
105105

106106
setScrollable: function( what, isScrollable ) {
@@ -139,7 +139,7 @@ return $.extend( helper, {
139139
},
140140

141141
trackMouseCss: function( el ) {
142-
el.bind( "drag", function() {
142+
el.on( "drag", function() {
143143
el.data( "last_dragged_cursor", $( "body" ).css( "cursor" ) );
144144
});
145145
},
@@ -149,7 +149,7 @@ return $.extend( helper, {
149149
el.draggable( "option", "helper", "clone" );
150150

151151
// Get what parent is at time of drag
152-
el.bind( "drag", function(e, ui) {
152+
el.on( "drag", function(e, ui) {
153153
el.data( "last_dragged_parent", ui.helper.parent()[ 0 ] );
154154
});
155155
}

tests/visual/draggable/replaced.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$(function() {
1414
$( "#draggable" )
1515
.draggable()
16-
.bind( "mousedown", function() {
16+
.on( "mousedown", function() {
1717
$( this ).html( "<div>replaced</div>" );
1818
});
1919
});

ui/draggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ $.widget("ui.draggable", $.ui.mouse, {
309309
// Only need to focus if the event occurred on the draggable itself, see #10527
310310
if ( this.handleElement.is( event.target ) ) {
311311
// The interaction is over; whether or not the click resulted in a drag, focus the element
312-
this.element.focus();
312+
this.element.trigger( "focus" );
313313
}
314314

315315
return $.ui.mouse.prototype._mouseUp.call(this, event);

0 commit comments

Comments
 (0)