-
Notifications
You must be signed in to change notification settings - Fork 1
/
_SlideMixin.js
72 lines (65 loc) · 2.24 KB
/
_SlideMixin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
define([
"dojo/_base/declare",
"dojo/_base/fx",
"dijit/_Widget",
"dojo/dom-style"
], function(declare, fx, _Widget, domStyle) {
return declare('slideshow._SlideMixin', [ _Widget ], {
postCreate: function () {
try {
domStyle.set(this.domNode, {'opacity': '0',
'display':'none',
'top': '0px',
'position': 'absolute'});
} catch (e) {
console.error(this.declaredClass+" "+arguments.callee.nom, arguments, e);
throw e;
}
},
onShow: function(){},
onLoad: function(){},
hide: function () {
try {
var node = this.domNode;
fx.animateProperty({
node: node, duration: 1000,
properties: {
opacity: { start: "1", end: "0" }
},
onEnd: function(){
domStyle.set(node, 'display', 'none');
},
rate: 5
}).play();
} catch (e) {
console.error(this.declaredClass+" "+arguments.callee.nom, arguments, e);
throw e;
}
},
show: function () {
try {
var node = this.domNode;
domStyle.set(node, 'display', '');
fx.animateProperty({
node: node, duration: 2000,
properties: {
opacity: { start: "0", end: "1" }
},
rate: 5
}).play();
this.onShow();
} catch (e) {
console.error(this.declaredClass+" "+arguments.callee.nom, arguments, e);
throw e;
}
},
isShowing: function () {
try {
return !!domStyle.get(this.domNode, 'opacity');
} catch (e) {
console.error(this.declaredClass+" "+arguments.callee.nom, arguments, e);
throw e;
}
}
});
});