| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library metrics; | 5 library metrics; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
| 10 import 'package:observatory/src/elements/helpers/nav_bar.dart'; | 10 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 _r.dirty(); | 148 _r.dirty(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 List<Element> _createMetricSelect() { | 151 List<Element> _createMetricSelect() { |
| 152 var s; | 152 var s; |
| 153 return [ | 153 return [ |
| 154 s = new SelectElement() | 154 s = new SelectElement() |
| 155 ..value = _selected.name | 155 ..value = _selected.name |
| 156 ..children = _available.map((metric) { | 156 ..children = _available.map((metric) { |
| 157 return new OptionElement( | 157 return new OptionElement( |
| 158 value: metric.name, | 158 value: metric.name, selected: _selected == metric) |
| 159 selected: _selected == metric)..text = metric.name; | 159 ..text = metric.name; |
| 160 }).toList(growable: false) | 160 }).toList(growable: false) |
| 161 ..onChange.listen((_) { | 161 ..onChange.listen((_) { |
| 162 _selected = _available[s.selectedIndex]; | 162 _selected = _available[s.selectedIndex]; |
| 163 _r.dirty(); | 163 _r.dirty(); |
| 164 }) | 164 }) |
| 165 ]; | 165 ]; |
| 166 } | 166 } |
| 167 } | 167 } |
| OLD | NEW |