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

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

Issue 184233007: Refactor Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 curly_block_element; 5 library curly_block_element;
6 6
7 import 'package:logging/logging.dart';
8 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
9 8
10 @CustomTag('curly-block') 9 @CustomTag('curly-block')
11 class CurlyBlockElement extends PolymerElement { 10 class CurlyBlockElement extends PolymerElement {
12 CurlyBlockElement.created() : super.created(); 11 CurlyBlockElement.created() : super.created();
13 12
14 @observable bool expanded = false; 13 @observable bool expanded = false;
15 @observable bool busy = false; 14 @observable bool busy = false;
16 @published var callback = null; 15 @published var callback = null;
17 16
18 void doneCallback() { 17 void doneCallback() {
19 print("done callback"); 18 print("done callback");
20 expanded = !expanded; 19 expanded = !expanded;
21 busy = false; 20 busy = false;
22 } 21 }
23 22
24 void toggleExpand(var a, var b, var c) { 23 void toggleExpand(var a, var b, var c) {
25 if (busy) { 24 if (busy) {
26 return; 25 return;
27 } 26 }
28 if (callback != null) { 27 if (callback != null) {
29 busy = true; 28 busy = true;
30 callback(!expanded, doneCallback); 29 callback(!expanded, doneCallback);
31 } else { 30 } else {
32 expanded = !expanded; 31 expanded = !expanded;
33 } 32 }
34 } 33 }
35 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698