OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview First run UI. | 6 * @fileoverview First run UI. |
7 */ | 7 */ |
8 | 8 |
9 // <include src="step.js"> | 9 // <include src="step.js"> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 return; | 30 return; |
31 } | 31 } |
32 var transitionDuration = (opt_transitionDuration === undefined) ? | 32 var transitionDuration = (opt_transitionDuration === undefined) ? |
33 cr.FirstRun.getDefaultTransitionDuration() : opt_transitionDuration; | 33 cr.FirstRun.getDefaultTransitionDuration() : opt_transitionDuration; |
34 var style = element.style; | 34 var style = element.style; |
35 var oldDurationValue = style.getPropertyValue('transition-duration'); | 35 var oldDurationValue = style.getPropertyValue('transition-duration'); |
36 style.setProperty('transition-duration', transitionDuration + 'ms'); | 36 style.setProperty('transition-duration', transitionDuration + 'ms'); |
37 var transition = visible ? 'show-animated' : 'hide-animated'; | 37 var transition = visible ? 'show-animated' : 'hide-animated'; |
38 classes.add(transition); | 38 classes.add(transition); |
39 classes.toggle('transparent'); | 39 classes.toggle('transparent'); |
40 element.addEventListener('webkitTransitionEnd', function f() { | 40 element.addEventListener('transitionend', function f() { |
41 element.removeEventListener('webkitTransitionEnd', f); | 41 element.removeEventListener('transitionend', f); |
42 classes.remove(transition); | 42 classes.remove(transition); |
43 if (oldDurationValue) | 43 if (oldDurationValue) |
44 style.setProperty('transition-duration', oldDurationValue); | 44 style.setProperty('transition-duration', oldDurationValue); |
45 else | 45 else |
46 style.removeProperty('transition-duration'); | 46 style.removeProperty('transition-duration'); |
47 if (opt_onFinished) | 47 if (opt_onFinished) |
48 opt_onFinished(); | 48 opt_onFinished(); |
49 }); | 49 }); |
50 ensureTransitionEndEvent(element, transitionDuration); | 50 ensureTransitionEndEvent(element, transitionDuration); |
51 } | 51 } |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 }; | 271 }; |
272 }); | 272 }); |
273 | 273 |
274 /** | 274 /** |
275 * Initializes UI. | 275 * Initializes UI. |
276 */ | 276 */ |
277 window.onload = function() { | 277 window.onload = function() { |
278 cr.FirstRun.initialize(); | 278 cr.FirstRun.initialize(); |
279 }; | 279 }; |
OLD | NEW |