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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/observatory_elements/curly_block.dart

Issue 182413007: Add new <curly-block> element. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js / fix bugs with reload Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library curly_block_element;
6
7 import 'package:logging/logging.dart';
8 import 'package:polymer/polymer.dart';
9
10 @CustomTag('curly-block')
11 class CurlyBlockElement extends PolymerElement {
12 CurlyBlockElement.created() : super.created();
13
14 @observable bool expanded = false;
15 @observable bool busy = false;
16 @published var callback = null;
17
18 void doneCallback() {
19 print("done callback");
20 expanded = !expanded;
21 busy = false;
22 }
23
24 void toggleExpand(var a, var b, var c) {
25 if (busy) {
26 return;
27 }
28 if (callback != null) {
29 busy = true;
30 callback(!expanded, doneCallback);
31 } else {
32 expanded = !expanded;
33 }
34 }
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698