Skip to content

Commit

Permalink
Effect.toggle to return effect ( to be able to do Effect.toggle(eleme…
Browse files Browse the repository at this point in the history
…nt, 'appear', {sync: true}); )
  • Loading branch information
RStankov authored and madrobby committed Oct 8, 2009
1 parent ad473ff commit eb7c15e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/effects.js
Expand Up @@ -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 || {}));
}
};

Expand Down

0 comments on commit eb7c15e

Please sign in to comment.