Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket #7105: Improving internal effects api #146

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Merge branch 'master' into effects-sub
Conflicts:
	ui/jquery.effects.core.js
	ui/jquery.effects.explode.js
  • Loading branch information
gnarf committed Mar 15, 2011
commit 3254e958bcd4510ddf384548315239e30f1c1030
23 changes: 13 additions & 10 deletions ui/jquery.effects.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
;jQuery.effects || (function($, undefined) {

var BC = $.uiBackCompat !== false;
var backCompat = $.uiBackCompat !== false;

$.effects = {
$: $.sub(),
Expand Down Expand Up @@ -523,7 +523,11 @@ function standardSpeed( speed ) {
}

// invalid strings - treat as "normal" speed
if ( typeof speed === "string" && ! ( $.effects.effect[ speed ] || BC && $.effects[ speed ] ) ) {
if ( typeof speed === "string" && !$.effects.effect[ speed ] ) {
// TODO: remove in 2.0 (#7115)
if ( backCompat && $.effects[ speed ] ) {
return false;
}
return true;
}

Expand All @@ -536,10 +540,10 @@ $.fn.extend({
mode = args.mode,
effectMethod = $.effects.effect[ args.effect ],

// DEPRECATED: Pre 1.9 API - effect functions existed in $.effects
oldEffectMethod = !effectMethod && BC && $.effects[ args.effect ];
// DEPRECATED: remove in 2.0 (#7115)
oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ];

if ( $.fx.off || ! ( effectMethod || oldEffectMethod ) ) {
if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
// delegate to the original method (e.g., .show()) if possible
if ( mode ) {
return this[ mode ]( args.duration, args.complete );
Expand All @@ -552,13 +556,12 @@ $.fn.extend({
}
}

// DEPRECATED: effectMethod will always be true once BC is removed
// TODO: remove this check in 2.0, effectMethod will always be true
if ( effectMethod ) {
return effectMethod.call( this, args );
return effectMethod.call( this, args );
} else {

// DEPRECATED: convert back to old format
return oldEffectMethod.call(this, {
// DEPRECATED: remove in 2.0 (#7115)
return oldEffectMethod.call(this, {
options: args,
duration: args.duration,
callback: args.complete,
Expand Down
7 changes: 1 addition & 6 deletions ui/jquery.effects.explode.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ $.effects.effect.explode = function( o ) {
var rows = o.pieces ? Math.round(Math.sqrt(o.pieces)) : 3,
cells = rows,
el = $.effects.$( this )
.show()
.css( 'visibility', 'hidden' ),
mode = el.setMode( o.mode || 'hide' ),
offset = el.offset(),
width = el.outerWidth( true ),
height = el.outerHeight( true ),
peices = [];
show = ( mode == 'show' ),

// show and then visibility:hidden the element before calculating offset
offset = el.show().css( 'visibility', 'hidden' ).offset(),
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.