Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Unified Diff: runtime/observatory/lib/src/elements/containers/virtual_tree.dart

Issue 2212253002: Converted Observatory class-tree element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Removed tmp code Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/elements/containers/virtual_tree.dart
diff --git a/runtime/observatory/lib/src/elements/containers/virtual_tree.dart b/runtime/observatory/lib/src/elements/containers/virtual_tree.dart
index 78ea96b988b14c3547c31fb428b24776394e44ff..4df0dd73c55c0e30aad3f5ddd3ed4b6a0920d5bf 100644
--- a/runtime/observatory/lib/src/elements/containers/virtual_tree.dart
+++ b/runtime/observatory/lib/src/elements/containers/virtual_tree.dart
@@ -4,6 +4,7 @@
import 'dart:async';
import 'dart:html';
+import 'dart:math' as Math;
import 'package:observatory/src/elements/containers/virtual_collection.dart';
import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
import 'package:observatory/src/elements/helpers/tag.dart';
@@ -13,6 +14,16 @@ typedef HtmlElement VirtualTreeCreateCallback(
typedef void VirtualTreeUpdateCallback(HtmlElement el, dynamic item, int depth);
typedef Iterable<dynamic> VritualTreeGetChildrenCallback(dynamic value);
+void virtualTreeUpdateLines(SpanElement element, int n) {
+ n = Math.max(0, n);
+ while (element.children.length > n) {
+ element.children.removeLast();
+ }
+ while (element.children.length < n) {
+ element.children.add(new SpanElement());
+ }
+}
+
class VirtualTreeElement extends HtmlElement implements Renderable {
static const tag =
const Tag<VirtualTreeElement>('virtual-tree', dependencies: const [

Powered by Google App Engine
This is Rietveld 408576698