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

Side by Side Diff: runtime/observatory/lib/src/elements/curly_block.dart

Issue 1265153005: Observatory fixes: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/observatory/tests/service/async_continuation_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
8 8
9 @CustomTag('curly-block') 9 @CustomTag('curly-block')
10 class CurlyBlockElement extends PolymerElement { 10 class CurlyBlockElement extends PolymerElement {
11 CurlyBlockElement.created() : super.created(); 11 CurlyBlockElement.created() : super.created();
12 12
13 @observable bool expanded = false; 13 @observable bool expanded = false;
14 @observable bool busy = false; 14 @observable bool busy = false;
15 @published var callback = null; 15 @published var callback = null;
16 @published bool expand = false; 16 @published bool expand = false;
17 17
18 void expandChanged(oldValue) { 18 void expandChanged(oldValue) {
19 expanded = expand; 19 expanded = expand;
20 } 20 }
21 21
22 void doneCallback() { 22 void doneCallback() {
23 expanded = !expanded; 23 expanded = !expanded;
24 busy = false; 24 busy = false;
25 } 25 }
26 26
27 void toggleExpand(var event, var b, var c) { 27 void toggleExpand(var event, var b, var c) {
28 assert(callback == null || expand == false); 28 assert(callback == null || expand == false);
29 event.stopPropagation();
30 if (busy) { 29 if (busy) {
31 return; 30 return;
32 } 31 }
33 if (callback != null) { 32 if (callback != null) {
34 busy = true; 33 busy = true;
35 callback(!expanded, doneCallback); 34 callback(!expanded, doneCallback);
36 } else { 35 } else {
37 expanded = !expanded; 36 expanded = !expanded;
38 } 37 }
39 } 38 }
40 } 39 }
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/tests/service/async_continuation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698