Line | |
---|
1 | define([ |
---|
2 | "dojo/_base/lang", |
---|
3 | "dojo/_base/fx", |
---|
4 | "dojo/dom-style", |
---|
5 | "dojo/fx" |
---|
6 | ], function(lang, baseFx, domStyle, fx) { |
---|
7 | |
---|
8 | function _fade(/*Object*/args, /*string*/action){ |
---|
9 | // summary: |
---|
10 | // Returns an animation of a fade out and fade in of the current and next |
---|
11 | // panes. It will either chain (fade) or combine (crossFade) the fade |
---|
12 | // animations. |
---|
13 | var n = args.next.node; |
---|
14 | domStyle.set(n, { |
---|
15 | display: "", |
---|
16 | opacity: 0 |
---|
17 | }); |
---|
18 | |
---|
19 | args.node = args.current.node; |
---|
20 | |
---|
21 | return fx[action]([ /*dojo.Animation*/ |
---|
22 | baseFx.fadeOut(args), |
---|
23 | baseFx.fadeIn(lang.mixin(args, { node: n })) |
---|
24 | ]); |
---|
25 | } |
---|
26 | |
---|
27 | var exports = { |
---|
28 | fade: function(/*Object*/args){ |
---|
29 | // summary: |
---|
30 | // Returns a dojo.Animation that fades out the current pane, then fades in |
---|
31 | // the next pane. |
---|
32 | return _fade(args, "chain"); /*dojo.Animation*/ |
---|
33 | }, |
---|
34 | |
---|
35 | crossFade: function(/*Object*/args){ |
---|
36 | // summary: |
---|
37 | // Returns a dojo.Animation that cross fades two rotator panes. |
---|
38 | return _fade(args, "combine"); /*dojo.Animation*/ |
---|
39 | } |
---|
40 | }; |
---|
41 | |
---|
42 | // back-compat, remove for 2.0 |
---|
43 | lang.mixin(lang.getObject("dojox.widget.rotator"), exports); |
---|
44 | |
---|
45 | return exports; |
---|
46 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.