1- // script.aculo.us effects.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
2-
3- // Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
1+ // script.aculo.us effects.js v1.9.0, 23 Dec 2010
2+ // Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
43// Contributors:
54// Justin Palmer (http://encytemedia.com/)
65// Mark Pilgrim (http://diveintomark.org/)
@@ -147,14 +146,13 @@ var Effect = {
147146 'blind' : [ 'BlindDown' , 'BlindUp' ] ,
148147 'appear' : [ 'Appear' , 'Fade' ]
149148 } ,
150- toggle : function ( element , effect ) {
149+ toggle : function ( element , effect , options ) {
151150 element = $ ( element ) ;
152151 effect = ( effect || 'appear' ) . toLowerCase ( ) ;
153- var options = Object . extend ( {
152+
153+ return Effect [ Effect . PAIRS [ effect ] [ element . visible ( ) ? 1 : 0 ] ] ( element , Object . extend ( {
154154 queue : { position :'end' , scope :( element . id || 'global' ) , limit : 1 }
155- } , arguments [ 2 ] || { } ) ;
156- Effect [ element . visible ( ) ?
157- Effect . PAIRS [ effect ] [ 1 ] : Effect . PAIRS [ effect ] [ 0 ] ] ( element , options ) ;
155+ } , options || { } ) ) ;
158156 }
159157} ;
160158
@@ -230,12 +228,6 @@ Effect.Queue = Effect.Queues.get('global');
230228Effect . Base = Class . create ( {
231229 position : null ,
232230 start : function ( options ) {
233- function codeForEvent ( options , eventName ) {
234- return (
235- ( options [ eventName + 'Internal' ] ? 'this.options.' + eventName + 'Internal(this);' : '' ) +
236- ( options [ eventName ] ? 'this.options.' + eventName + '(this);' : '' )
237- ) ;
238- }
239231 if ( options && options . transition === false ) options . transition = Effect . Transitions . linear ;
240232 this . options = Object . extend ( Object . extend ( { } , Effect . DefaultOptions ) , options || { } ) ;
241233 this . currentFrame = 0 ;
@@ -1127,4 +1119,4 @@ $w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTex
11271119 function ( f ) { Effect . Methods [ f ] = Element [ f ] ; }
11281120) ;
11291121
1130- Element . addMethods ( Effect . Methods ) ;
1122+ Element . addMethods ( Effect . Methods ) ;
0 commit comments