Skip to content

Commit 2b9d684

Browse files
malsupscottgonzalez
authored andcommitted
Effects: Fix show/hide/toggle test for using core functions. Fixed: #5456 - show() function broken with "normal" speed
1 parent 3be1105 commit 2b9d684

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/jquery.effects.core.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ $.fn.extend({
455455

456456
_show: $.fn.show,
457457
show: function(speed) {
458-
if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) {
458+
if (!speed || typeof speed == 'number' || $.fx.speeds[speed] || !$.effects[speed] ) {
459459
return this._show.apply(this, arguments);
460460
} else {
461461
var args = _normalizeArguments.apply(this, arguments);
@@ -466,7 +466,7 @@ $.fn.extend({
466466

467467
_hide: $.fn.hide,
468468
hide: function(speed) {
469-
if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) {
469+
if (!speed || typeof speed == 'number' || $.fx.speeds[speed] || !$.effects[speed] ) {
470470
return this._hide.apply(this, arguments);
471471
} else {
472472
var args = _normalizeArguments.apply(this, arguments);
@@ -475,10 +475,10 @@ $.fn.extend({
475475
}
476476
},
477477

478-
// jQuery core overloads toggle and create _toggle
478+
// jQuery core overloads toggle and creates _toggle
479479
__toggle: $.fn.toggle,
480480
toggle: function(speed) {
481-
if (!speed || typeof speed == 'number' || $.fx.speeds[speed] ||
481+
if (!speed || typeof speed == 'number' || $.fx.speeds[speed] || !$.effects[speed] ||
482482
typeof speed == 'boolean' || $.isFunction(speed)) {
483483
return this.__toggle.apply(this, arguments);
484484
} else {

0 commit comments

Comments
 (0)