OLD | NEW |
---|---|
(Empty) | |
1 <polymer-element name="viewer-toolbar" attributes="fadingIn" | |
2 on-mouseover="{{fadeIn}}" on-mousemove="{{fadeIn}}" | |
3 on-mouseout="{{fadeOut}}"> | |
4 <template> | |
5 <link rel="stylesheet" href="viewer-toolbar.css"> | |
6 <div id="toolbar"> | |
7 <content></content> | |
8 </div> | |
9 </template> | |
10 <script> | |
11 Polymer('viewer-toolbar', { | |
12 fadingIn: false, | |
13 timerIsRunning: false, | |
14 timerId: 0, | |
15 ready: function() { | |
16 this.fadingInChanged(); | |
17 }, | |
18 fadeIn: function() { | |
19 this.fadingIn = true; | |
20 }, | |
21 fadeOut: function() { | |
22 this.fadingIn = false; | |
23 }, | |
24 fadingInChanged: function() { | |
25 if (this.fadingIn) { | |
26 this.style.opacity = 1; | |
27 if (this.timerIsRunning) { | |
28 this.timerIsRunning = false; | |
29 clearTimeout(this.timerId); | |
30 } | |
31 } else { | |
32 if (!this.timerIsRunning) { | |
33 this.timerIsRunning = true; | |
34 this.timerId = setTimeout( | |
35 function() { this.style.opacity = 0; }.bind(this), 3000); | |
36 } | |
ganetsky1
2014/01/03 18:14:39
There are numerous things I don't understand here:
raymes
2014/01/06 00:22:45
1) Done, thanks.
2) The transition has been moved
ganetsky1
2014/01/08 06:13:43
Please correct me if I'm wrong somewhere:
There s
| |
37 } | |
38 } | |
39 }); | |
40 </script> | |
41 </polymer-element> | |
OLD | NEW |