mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Effects: Remove core event/alias and deprecated module dependencies
This commit is contained in:
parent
e543253468
commit
5ee324dd72
@ -15,7 +15,7 @@
|
|||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
$( "#effect" ).addClass( "newClass", 1000, callback );
|
$( "#effect" ).addClass( "newClass", 1000, callback );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
var state = true;
|
var state = true;
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
if ( state ) {
|
if ( state ) {
|
||||||
$( "#effect" ).animate({
|
$( "#effect" ).animate({
|
||||||
backgroundColor: "#aa0000",
|
backgroundColor: "#aa0000",
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// set effect from select menu value
|
// set effect from select menu value
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
runEffect();
|
runEffect();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
||||||
// animate on click
|
// animate on click
|
||||||
graph.click(function() {
|
graph.on( "click", function() {
|
||||||
wrap
|
wrap
|
||||||
.animate( { height: "hide" }, 2000, name )
|
.animate( { height: "hide" }, 2000, name )
|
||||||
.delay( 800 )
|
.delay( 800 )
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// set effect from select menu value
|
// set effect from select menu value
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
runEffect();
|
runEffect();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
$( "#effect" ).removeClass( "newClass", 1000, callback );
|
$( "#effect" ).removeClass( "newClass", 1000, callback );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// set effect from select menu value
|
// set effect from select menu value
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
runEffect();
|
runEffect();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#button" ).click(function(){
|
$( "#button" ).on( "click", function(){
|
||||||
$( ".newClass" ).switchClass( "newClass", "anotherNewClass", 1000 );
|
$( ".newClass" ).switchClass( "newClass", "anotherNewClass", 1000 );
|
||||||
$( ".anotherNewClass" ).switchClass( "anotherNewClass", "newClass", 1000 );
|
$( ".anotherNewClass" ).switchClass( "anotherNewClass", "newClass", 1000 );
|
||||||
});
|
});
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// set effect from select menu value
|
// set effect from select menu value
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
runEffect();
|
runEffect();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#button" ).click(function() {
|
$( "#button" ).on( "click", function() {
|
||||||
$( "#effect" ).toggleClass( "newClass", 1000 );
|
$( "#effect" ).toggleClass( "newClass", 1000 );
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -12,14 +12,14 @@
|
|||||||
var target = $( ".target" ),
|
var target = $( ".target" ),
|
||||||
duration = 2000;
|
duration = 2000;
|
||||||
|
|
||||||
$( ".toggle" ).click(function( event ) {
|
$( ".toggle" ).on( "click", function( event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
target.toggle( "clip", {
|
target.toggle( "clip", {
|
||||||
direction: "horizontal"
|
direction: "horizontal"
|
||||||
}, duration );
|
}, duration );
|
||||||
});
|
});
|
||||||
|
|
||||||
$( ".effect-toggle" ).click(function( event ) {
|
$( ".effect-toggle" ).on( "click", function( event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
target.effect( "clip", {
|
target.effect( "clip", {
|
||||||
direction: "vertical",
|
direction: "vertical",
|
||||||
@ -27,7 +27,7 @@
|
|||||||
}, duration );
|
}, duration );
|
||||||
});
|
});
|
||||||
|
|
||||||
$( ".effect-default" ).click(function( event ) {
|
$( ".effect-default" ).on( "click", function( event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
target.effect( "clip", {
|
target.effect( "clip", {
|
||||||
direction: "vertical"
|
direction: "vertical"
|
||||||
|
16
tests/visual/effects/effects.js
vendored
16
tests/visual/effects/effects.js
vendored
@ -8,7 +8,7 @@ function effect( elem, name, options ) {
|
|||||||
easing: "easeOutQuint"
|
easing: "easeOutQuint"
|
||||||
});
|
});
|
||||||
|
|
||||||
$( elem ).click(function() {
|
$( elem ).on( "click", function() {
|
||||||
$( this )
|
$( this )
|
||||||
.addClass( "current" )
|
.addClass( "current" )
|
||||||
// delaying the initial animation makes sure that the queue stays in tact
|
// delaying the initial animation makes sure that the queue stays in tact
|
||||||
@ -21,7 +21,7 @@ function effect( elem, name, options ) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$( "#hide" ).click(function() {
|
$( "#hide" ).on( "click", function() {
|
||||||
$( this )
|
$( this )
|
||||||
.addClass( "current" )
|
.addClass( "current" )
|
||||||
.hide( duration )
|
.hide( duration )
|
||||||
@ -60,7 +60,7 @@ effect( "#pulsate", "pulsate", { times: 2 } );
|
|||||||
effect( "#puff", "puff", {} );
|
effect( "#puff", "puff", {} );
|
||||||
effect( "#scale", "scale", {} );
|
effect( "#scale", "scale", {} );
|
||||||
effect( "#size", "size", {} );
|
effect( "#size", "size", {} );
|
||||||
$( "#sizeToggle" ).click(function() {
|
$( "#sizeToggle" ).on( "click", function() {
|
||||||
var options = { to: { width: 300, height: 300 } };
|
var options = { to: { width: 300, height: 300 } };
|
||||||
$( this )
|
$( this )
|
||||||
.addClass( "current" )
|
.addClass( "current" )
|
||||||
@ -71,7 +71,7 @@ $( "#sizeToggle" ).click(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$( "#shake" ).click(function() {
|
$( "#shake" ).on( "click", function() {
|
||||||
$( this )
|
$( this )
|
||||||
.addClass( "current" )
|
.addClass( "current" )
|
||||||
.effect( "shake", {}, 100, function() {
|
.effect( "shake", {}, 100, function() {
|
||||||
@ -84,7 +84,7 @@ effect( "#slideUp", "slide", { direction: "up" } );
|
|||||||
effect( "#slideLeft", "slide", { direction: "left" } );
|
effect( "#slideLeft", "slide", { direction: "left" } );
|
||||||
effect( "#slideRight", "slide", { direction: "right" } );
|
effect( "#slideRight", "slide", { direction: "right" } );
|
||||||
|
|
||||||
$( "#transfer" ).click(function() {
|
$( "#transfer" ).on( "click", function() {
|
||||||
$( this )
|
$( this )
|
||||||
.addClass( "current" )
|
.addClass( "current" )
|
||||||
.effect( "transfer", { to: "div:eq(0)" }, 1000, function() {
|
.effect( "transfer", { to: "div:eq(0)" }, 1000, function() {
|
||||||
@ -92,15 +92,15 @@ $( "#transfer" ).click(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$( "#addClass" ).click(function() {
|
$( "#addClass" ).on( "click", function() {
|
||||||
$( this ).addClass( "current", duration, function() {
|
$( this ).addClass( "current", duration, function() {
|
||||||
$( this ).removeClass( "current" );
|
$( this ).removeClass( "current" );
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$( "#removeClass" ).click(function() {
|
$( "#removeClass" ).on( "click", function() {
|
||||||
$( this ).addClass( "current" ).removeClass( "current", duration );
|
$( this ).addClass( "current" ).removeClass( "current", duration );
|
||||||
});
|
});
|
||||||
$( "#toggleClass" ).click(function() {
|
$( "#toggleClass" ).on( "click", function() {
|
||||||
$( this ).toggleClass( "current", duration );
|
$( this ).toggleClass( "current", duration );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@
|
|||||||
total *= this.options.length;
|
total *= this.options.length;
|
||||||
});
|
});
|
||||||
|
|
||||||
opts.change( doAnim );
|
opts.on( "change", doAnim );
|
||||||
doer.click( doAnim );
|
doer.on( "click", doAnim );
|
||||||
$( "#cyclePrev" ).click(function() {
|
$( "#cyclePrev" ).on( "click", function() {
|
||||||
cycle( -1 );
|
cycle( -1 );
|
||||||
});
|
});
|
||||||
$( "#cycleNext" ).click(function() {
|
$( "#cycleNext" ).on( "click", function() {
|
||||||
cycle( 1 );
|
cycle( 1 );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<script src="../../../ui/effect-shake.js"></script>
|
<script src="../../../ui/effect-shake.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#btn" ).click(function() {
|
$( "#btn" ).on( "click", function() {
|
||||||
$( ".shake" ).effect( "shake", {
|
$( ".shake" ).effect( "shake", {
|
||||||
duration: +$( "#duration" ).val(),
|
duration: +$( "#duration" ).val(),
|
||||||
mode: "toggle"
|
mode: "toggle"
|
||||||
|
@ -991,7 +991,7 @@ if ( $.uiBackCompat !== false ) {
|
|||||||
|
|
||||||
// Fixes #7595 - Elements lose focus when wrapped.
|
// Fixes #7595 - Elements lose focus when wrapped.
|
||||||
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
|
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
|
||||||
$( active ).focus();
|
$( active ).trigger( "focus" );
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
|
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 ) {
|
|||||||
|
|
||||||
// Fixes #7595 - Elements lose focus when wrapped.
|
// Fixes #7595 - Elements lose focus when wrapped.
|
||||||
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
|
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
|
||||||
$( active ).focus();
|
$( active ).trigger( "focus" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user