OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** Ported from `polymer/src/boot.js`. **/ | 5 /// Ported from `polymer/src/boot.js`. * |
6 part of polymer; | 6 part of polymer; |
7 | 7 |
8 /** Prevent a flash of unstyled content. */ | 8 /// Prevent a flash of unstyled content. |
9 _preventFlashOfUnstyledContent() { | 9 _preventFlashOfUnstyledContent() { |
10 | 10 |
11 var style = new StyleElement(); | 11 var style = new StyleElement(); |
12 style.text = '.$_VEILED_CLASS { ' | 12 style.text = '.$_VEILED_CLASS { ' |
13 'opacity: 0; } \n' | 13 'opacity: 0; } \n' |
14 '.$_UNVEIL_CLASS{ ' | 14 '.$_UNVEIL_CLASS{ ' |
15 '-webkit-transition: opacity ${_TRANSITION_TIME}s; ' | 15 '-webkit-transition: opacity ${_TRANSITION_TIME}s; ' |
16 'transition: opacity ${_TRANSITION_TIME}s; }\n'; | 16 'transition: opacity ${_TRANSITION_TIME}s; }\n'; |
17 | 17 |
18 // Note: we use `query` and not `document.head` to make sure this code works | 18 // Note: we use `query` and not `document.head` to make sure this code works |
(...skipping 14 matching lines...) Expand all Loading... |
33 const _TRANSITION_TIME = 0.3; | 33 const _TRANSITION_TIME = 0.3; |
34 | 34 |
35 // apply veiled class | 35 // apply veiled class |
36 _veilElements() { | 36 _veilElements() { |
37 for (var selector in Polymer.veiledElements) { | 37 for (var selector in Polymer.veiledElements) { |
38 for (var node in document.querySelectorAll(selector)) { | 38 for (var node in document.querySelectorAll(selector)) { |
39 node.classes.add(_VEILED_CLASS); | 39 node.classes.add(_VEILED_CLASS); |
40 } | 40 } |
41 } | 41 } |
42 } | 42 } |
OLD | NEW |