]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * @private\r | |
3 | */\r | |
4 | Ext.define('Ext.fx.layout.card.Flip', {\r | |
5 | extend: 'Ext.fx.layout.card.Style',\r | |
6 | \r | |
7 | alias: 'fx.layout.card.flip',\r | |
8 | \r | |
9 | config: {\r | |
10 | duration: 500,\r | |
11 | \r | |
12 | inAnimation: {\r | |
13 | type: 'flip',\r | |
14 | half: true,\r | |
15 | easing: 'ease-out',\r | |
16 | before: {\r | |
17 | 'backface-visibility': 'hidden'\r | |
18 | },\r | |
19 | after: {\r | |
20 | 'backface-visibility': null\r | |
21 | }\r | |
22 | },\r | |
23 | outAnimation: {\r | |
24 | type: 'flip',\r | |
25 | half: true,\r | |
26 | easing: 'ease-in',\r | |
27 | before: {\r | |
28 | 'backface-visibility': 'hidden'\r | |
29 | },\r | |
30 | after: {\r | |
31 | 'backface-visibility': null\r | |
32 | },\r | |
33 | out: true\r | |
34 | }\r | |
35 | },\r | |
36 | \r | |
37 | onActiveItemChange: function(cardLayout, newItem, oldItem, controller) {\r | |
38 | var parent = newItem.element.getParent();\r | |
39 | parent.addCls(Ext.baseCSSPrefix + 'layout-card-perspective');\r | |
40 | \r | |
41 | this.on('animationend', function() {\r | |
42 | parent.removeCls(Ext.baseCSSPrefix + 'layout-card-perspective');\r | |
43 | }, this, {single: true});\r | |
44 | \r | |
45 | this.callParent(arguments);\r | |
46 | },\r | |
47 | \r | |
48 | updateDuration: function(duration) {\r | |
49 | var halfDuration = duration / 2,\r | |
50 | inAnimation = this.getInAnimation(),\r | |
51 | outAnimation = this.getOutAnimation();\r | |
52 | \r | |
53 | inAnimation.setDelay(halfDuration);\r | |
54 | inAnimation.setDuration(halfDuration);\r | |
55 | outAnimation.setDuration(halfDuration);\r | |
56 | }\r | |
57 | });\r |