blob: 4f65a39ab3b9d3d85b488fed10d06c65f572f591 [file] [log] [blame]
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library library_ref_element;
import 'package:observatory/service.dart';
import 'package:polymer/polymer.dart';
import 'service_ref.dart';
import 'dart:async';
@CustomTag('library-ref')
class LibraryRefElement extends ServiceRefElement {
@observable bool asValue = false;
LibraryRefElement.created() : super.created();
String makeExpandKey(String key) {
return '${expandKey}/${key}';
}
dynamic expander() {
return expandEvent;
}
void expandEvent(bool expand, Function onDone) {
if (expand) {
Library lib = ref;
lib.reload().then((result) {
return Future.wait(lib.variables.map((field) => field.reload()));
}).whenComplete(onDone);
} else {
onDone();
}
}
}