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 library flag_list_element; | 5 library flag_list_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 _flags = flags; | 129 _flags = flags; |
130 _r.dirty(); | 130 _r.dirty(); |
131 }); | 131 }); |
132 } | 132 } |
133 | 133 |
134 static bool _isModified(M.Flag flag) => flag.modified; | 134 static bool _isModified(M.Flag flag) => flag.modified; |
135 static bool _isUnmodified(M.Flag flag) => !flag.modified; | 135 static bool _isUnmodified(M.Flag flag) => !flag.modified; |
136 | 136 |
137 static List<Element> _renderFlag(M.Flag flag) { | 137 static List<Element> _renderFlag(M.Flag flag) { |
138 return [ | 138 return [ |
139 new SpanElement()..classes = const ['comment'] | 139 new SpanElement()..classes = ['comment'] |
140 ..text = '// ${flag.comment}', | 140 ..text = '// ${flag.comment}', |
141 new DivElement()..classes = flag.modified ? const ['flag', 'modified'] | 141 new DivElement()..classes = flag.modified ? ['flag', 'modified'] |
142 : const ['flag', 'unmodified'] | 142 : ['flag', 'unmodified'] |
143 ..children = [ | 143 ..children = [ |
144 new SpanElement()..classes = const ['name'] | 144 new SpanElement()..classes = ['name'] |
145 ..text = flag.name, | 145 ..text = flag.name, |
146 new SpanElement()..text = '=', | 146 new SpanElement()..text = '=', |
147 new SpanElement()..classes = const ['value'] | 147 new SpanElement()..classes = ['value'] |
148 ..text = flag.valueAsString ?? 'NULL' | 148 ..text = flag.valueAsString ?? 'NULL' |
149 ], | 149 ], |
150 new BRElement(), | 150 new BRElement(), |
151 ]; | 151 ]; |
152 } | 152 } |
153 } | 153 } |
OLD | NEW |