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)
4
3
// Contributors:
5
4
// Justin Palmer (http://encytemedia.com/)
6
5
// Mark Pilgrim (http://diveintomark.org/)
@@ -147,14 +146,13 @@ var Effect = {
147
146
'blind' : [ 'BlindDown' , 'BlindUp' ] ,
148
147
'appear' : [ 'Appear' , 'Fade' ]
149
148
} ,
150
- toggle : function ( element , effect ) {
149
+ toggle : function ( element , effect , options ) {
151
150
element = $ ( element ) ;
152
151
effect = ( effect || 'appear' ) . toLowerCase ( ) ;
153
- var options = Object . extend ( {
152
+
153
+ return Effect [ Effect . PAIRS [ effect ] [ element . visible ( ) ? 1 : 0 ] ] ( element , Object . extend ( {
154
154
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 || { } ) ) ;
158
156
}
159
157
} ;
160
158
@@ -230,12 +228,6 @@ Effect.Queue = Effect.Queues.get('global');
230
228
Effect . Base = Class . create ( {
231
229
position : null ,
232
230
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
- }
239
231
if ( options && options . transition === false ) options . transition = Effect . Transitions . linear ;
240
232
this . options = Object . extend ( Object . extend ( { } , Effect . DefaultOptions ) , options || { } ) ;
241
233
this . currentFrame = 0 ;
@@ -1127,4 +1119,4 @@ $w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTex
1127
1119
function ( f ) { Effect . Methods [ f ] = Element [ f ] ; }
1128
1120
) ;
1129
1121
1130
- Element . addMethods ( Effect . Methods ) ;
1122
+ Element . addMethods ( Effect . Methods ) ;
0 commit comments