Permalink
Browse files

Effect.toggle to return effect ( to be able to do Effect.toggle(eleme…

…nt, 'appear', {sync: true}); )
  • Loading branch information...
1 parent ad473ff commit eb7c15e6635bfb3c2fbde240ca546b97fb7e7bba @RStankov RStankov committed with Jul 14, 2009
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/effects.js
View
@@ -145,14 +145,13 @@ var Effect = {
'blind': ['BlindDown','BlindUp'],
'appear': ['Appear','Fade']
},
- toggle: function(element, effect) {
+ toggle: function(element, effect, options) {
element = $(element);
- effect = (effect || 'appear').toLowerCase();
- var options = Object.extend({
+ effect = (effect || 'appear').toLowerCase();
+
+ return Effect[ Effect.PAIRS[ effect ][ element.visible() ? 1 : 0 ] ](element, Object.extend({
queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
- }, arguments[2] || { });
- Effect[element.visible() ?
- Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
+ }, options || {}));
}
};

0 comments on commit eb7c15e

Please sign in to comment.