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

Side by Side Diff: samples/ui_lib/view/view.dart

Issue 10544076: Changes to run Swarm from the Editor and to suppress warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up a constructor Created 8 years, 6 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
« no previous file with comments | « samples/swarm/UIState.dart ('k') | no next file » | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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("view"); 5 #library("view");
6 6
7 #import('dart:html'); 7 #import('dart:html');
8 #import('../base/base.dart'); 8 #import('../base/base.dart');
9 #import('../observable/observable.dart'); 9 #import('../observable/observable.dart');
10 #import('../touch/touch.dart'); 10 #import('../touch/touch.dart');
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 /** Gets whether this View has already been rendered or not. */ 101 /** Gets whether this View has already been rendered or not. */
102 bool get isRendered() { 102 bool get isRendered() {
103 return _node !== null; 103 return _node !== null;
104 } 104 }
105 105
106 /** 106 /**
107 * Gets whether this View (or one of its parents) has been added to the 107 * Gets whether this View (or one of its parents) has been added to the
108 * document or not. 108 * document or not.
109 */ 109 */
110 bool get isInDocument() { 110 bool get isInDocument() {
111 return _node !== null && node.document.contains(node); 111 return _node !== null && node.document.body.contains(node);
112 } 112 }
113 113
114 /** 114 /**
115 * Adds this view to the document as a child of the given node. This should 115 * Adds this view to the document as a child of the given node. This should
116 * generally only be called once for the top-level view. 116 * generally only be called once for the top-level view.
117 */ 117 */
118 void addToDocument(Element parentNode) { 118 void addToDocument(Element parentNode) {
119 assert(!isInDocument); 119 assert(!isInDocument);
120 120
121 _render(); 121 _render();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } 362 }
363 } 363 }
364 364
365 void _applyLayout() { 365 void _applyLayout() {
366 if (_layout != null) { 366 if (_layout != null) {
367 _layout.applyLayout(); 367 _layout.applyLayout();
368 } 368 }
369 _applyLayoutToChildren(); 369 _applyLayoutToChildren();
370 } 370 }
371 } 371 }
OLDNEW
« no previous file with comments | « samples/swarm/UIState.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698