| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 typedef void SelectHandler(String menuText); | 5 typedef void SelectHandler(String menuText); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * This implements a horizontal menu bar with a sliding triangle arrow | 8 * This implements a horizontal menu bar with a sliding triangle arrow |
| 9 * that points at the currently selected item. | 9 * that points at the currently selected item. |
| 10 */ | 10 */ |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 if (selectedItem != null) { | 157 if (selectedItem != null) { |
| 158 // calculate where we want to put the triangle | 158 // calculate where we want to put the triangle |
| 159 x = selectedItem.offsetLeft + | 159 x = selectedItem.offsetLeft + |
| 160 selectedItem.offsetWidth / 2 - TRIANGLE_WIDTH / 2; | 160 selectedItem.offsetWidth / 2 - TRIANGLE_WIDTH / 2; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // find the slider filler (the div element to the left of the | 163 // find the slider filler (the div element to the left of the |
| 164 // triangle) set its width the push the triangle to where we want it. | 164 // triangle) set its width the push the triangle to where we want it. |
| 165 String duration = animate ? '.3s' : '0s'; | 165 String duration = animate ? '.3s' : '0s'; |
| 166 final triangle = node.query('.sm-triangle'); | 166 final triangle = node.query('.sm-triangle'); |
| 167 Css.setTransitionDuration(triangle.style, duration); | 167 triangle.style.transitionDuration = duration; |
| 168 FxUtil.setWebkitTransform(triangle, x, 0); | 168 FxUtil.setWebkitTransform(triangle, x, 0); |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |