Skip to content

Commit 5ee324d

Browse files
committed
Effects: Remove core event/alias and deprecated module dependencies
1 parent e543253 commit 5ee324d

File tree

15 files changed

+28
-28
lines changed

15 files changed

+28
-28
lines changed

demos/effect/addClass.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</style>
1616
<script>
1717
$(function() {
18-
$( "#button" ).click(function() {
18+
$( "#button" ).on( "click", function() {
1919
$( "#effect" ).addClass( "newClass", 1000, callback );
2020
});
2121

demos/effect/animate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<script>
1717
$(function() {
1818
var state = true;
19-
$( "#button" ).click(function() {
19+
$( "#button" ).on( "click", function() {
2020
if ( state ) {
2121
$( "#effect" ).animate({
2222
backgroundColor: "#aa0000",

demos/effect/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
};
6060

6161
// set effect from select menu value
62-
$( "#button" ).click(function() {
62+
$( "#button" ).on( "click", function() {
6363
runEffect();
6464
return false;
6565
});

demos/effect/easing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
ctx.stroke();
8080

8181
// animate on click
82-
graph.click(function() {
82+
graph.on( "click", function() {
8383
wrap
8484
.animate( { height: "hide" }, 2000, name )
8585
.delay( 800 )

demos/effect/hide.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
};
5656

5757
// set effect from select menu value
58-
$( "#button" ).click(function() {
58+
$( "#button" ).on( "click", function() {
5959
runEffect();
6060
});
6161
});

demos/effect/removeClass.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</style>
1616
<script>
1717
$(function() {
18-
$( "#button" ).click(function() {
18+
$( "#button" ).on( "click", function() {
1919
$( "#effect" ).removeClass( "newClass", 1000, callback );
2020
});
2121

demos/effect/show.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
};
5656

5757
// set effect from select menu value
58-
$( "#button" ).click(function() {
58+
$( "#button" ).on( "click", function() {
5959
runEffect();
6060
});
6161

demos/effect/switchClass.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</style>
1717
<script>
1818
$(function() {
19-
$( "#button" ).click(function(){
19+
$( "#button" ).on( "click", function(){
2020
$( ".newClass" ).switchClass( "newClass", "anotherNewClass", 1000 );
2121
$( ".anotherNewClass" ).switchClass( "anotherNewClass", "newClass", 1000 );
2222
});

demos/effect/toggle.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
};
6464

6565
// set effect from select menu value
66-
$( "#button" ).click(function() {
66+
$( "#button" ).on( "click", function() {
6767
runEffect();
6868
});
6969
});

demos/effect/toggleClass.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</style>
1616
<script>
1717
$(function() {
18-
$( "#button" ).click(function() {
18+
$( "#button" ).on( "click", function() {
1919
$( "#effect" ).toggleClass( "newClass", 1000 );
2020
});
2121
});

tests/visual/effects/clip.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
var target = $( ".target" ),
1313
duration = 2000;
1414

15-
$( ".toggle" ).click(function( event ) {
15+
$( ".toggle" ).on( "click", function( event ) {
1616
event.preventDefault();
1717
target.toggle( "clip", {
1818
direction: "horizontal"
1919
}, duration );
2020
});
2121

22-
$( ".effect-toggle" ).click(function( event ) {
22+
$( ".effect-toggle" ).on( "click", function( event ) {
2323
event.preventDefault();
2424
target.effect( "clip", {
2525
direction: "vertical",
2626
mode: "toggle"
2727
}, duration );
2828
});
2929

30-
$( ".effect-default" ).click(function( event ) {
30+
$( ".effect-default" ).on( "click", function( event ) {
3131
event.preventDefault();
3232
target.effect( "clip", {
3333
direction: "vertical"

tests/visual/effects/effects.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function effect( elem, name, options ) {
88
easing: "easeOutQuint"
99
});
1010

11-
$( elem ).click(function() {
11+
$( elem ).on( "click", function() {
1212
$( this )
1313
.addClass( "current" )
1414
// delaying the initial animation makes sure that the queue stays in tact
@@ -21,7 +21,7 @@ function effect( elem, name, options ) {
2121
});
2222
}
2323

24-
$( "#hide" ).click(function() {
24+
$( "#hide" ).on( "click", function() {
2525
$( this )
2626
.addClass( "current" )
2727
.hide( duration )
@@ -60,7 +60,7 @@ effect( "#pulsate", "pulsate", { times: 2 } );
6060
effect( "#puff", "puff", {} );
6161
effect( "#scale", "scale", {} );
6262
effect( "#size", "size", {} );
63-
$( "#sizeToggle" ).click(function() {
63+
$( "#sizeToggle" ).on( "click", function() {
6464
var options = { to: { width: 300, height: 300 } };
6565
$( this )
6666
.addClass( "current" )
@@ -71,7 +71,7 @@ $( "#sizeToggle" ).click(function() {
7171
});
7272
});
7373

74-
$( "#shake" ).click(function() {
74+
$( "#shake" ).on( "click", function() {
7575
$( this )
7676
.addClass( "current" )
7777
.effect( "shake", {}, 100, function() {
@@ -84,23 +84,23 @@ effect( "#slideUp", "slide", { direction: "up" } );
8484
effect( "#slideLeft", "slide", { direction: "left" } );
8585
effect( "#slideRight", "slide", { direction: "right" } );
8686

87-
$( "#transfer" ).click(function() {
87+
$( "#transfer" ).on( "click", function() {
8888
$( this )
8989
.addClass( "current" )
9090
.effect( "transfer", { to: "div:eq(0)" }, 1000, function() {
9191
$( this ).removeClass( "current" );
9292
});
9393
});
9494

95-
$( "#addClass" ).click(function() {
95+
$( "#addClass" ).on( "click", function() {
9696
$( this ).addClass( "current", duration, function() {
9797
$( this ).removeClass( "current" );
9898
});
9999
});
100-
$( "#removeClass" ).click(function() {
100+
$( "#removeClass" ).on( "click", function() {
101101
$( this ).addClass( "current" ).removeClass( "current", duration );
102102
});
103-
$( "#toggleClass" ).click(function() {
103+
$( "#toggleClass" ).on( "click", function() {
104104
$( this ).toggleClass( "current", duration );
105105
});
106106

tests/visual/effects/scale.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
total *= this.options.length;
2222
});
2323

24-
opts.change( doAnim );
25-
doer.click( doAnim );
26-
$( "#cyclePrev" ).click(function() {
24+
opts.on( "change", doAnim );
25+
doer.on( "click", doAnim );
26+
$( "#cyclePrev" ).on( "click", function() {
2727
cycle( -1 );
2828
});
29-
$( "#cycleNext" ).click(function() {
29+
$( "#cycleNext" ).on( "click", function() {
3030
cycle( 1 );
3131
});
3232

tests/visual/effects/shake.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<script src="../../../ui/effect-shake.js"></script>
1111
<script>
1212
$(function() {
13-
$( "#btn" ).click(function() {
13+
$( "#btn" ).on( "click", function() {
1414
$( ".shake" ).effect( "shake", {
1515
duration: +$( "#duration" ).val(),
1616
mode: "toggle"

ui/effect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ if ( $.uiBackCompat !== false ) {
991991

992992
// Fixes #7595 - Elements lose focus when wrapped.
993993
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
994-
$( active ).focus();
994+
$( active ).trigger( "focus" );
995995
}
996996

997997
wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
@@ -1032,7 +1032,7 @@ if ( $.uiBackCompat !== false ) {
10321032

10331033
// Fixes #7595 - Elements lose focus when wrapped.
10341034
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
1035-
$( active ).focus();
1035+
$( active ).trigger( "focus" );
10361036
}
10371037
}
10381038

0 commit comments

Comments
 (0)