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

Unified Diff: client/samples/dartcombat/views.dart

Issue 8835006: New version of dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/samples/dartcombat/setup.dart ('k') | client/samples/isolate/IsolateSample.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/samples/dartcombat/views.dart
diff --git a/client/samples/dartcombat/views.dart b/client/samples/dartcombat/views.dart
index 3b411e24d3a0eba2536a0d5b0d52deac34dea806..a565f5d831b630b2b2decd9b488e9f3e2ee5a646 100644
--- a/client/samples/dartcombat/views.dart
+++ b/client/samples/dartcombat/views.dart
@@ -45,14 +45,14 @@ class PlayerGridView extends View {
/** Adds to this view the respresentation of a missed shot. */
void addMiss(int x, int y) {
- Element node = ViewUtil.createDiv(this, "icons miss");
+ Element node = ViewUtil.createDiv("icons miss");
ViewUtil.placeNodeAt(node, x, y);
_rootNode.nodes.add(node);
}
/** Adds to this view the respresentation of a shot that hits our boat. */
void addHit(int x, int y) {
- Element node = ViewUtil.createDiv(this, "icons hit-onboat");
+ Element node = ViewUtil.createDiv("icons hit-onboat");
ViewUtil.placeNodeAt(node, x, y);
_rootNode.nodes.add(node);
}
@@ -99,7 +99,7 @@ class PlaceBoatView extends View {
_possibleBoat.remove();
_moveListener = null;
}
- _possibleBoat = ViewUtil.createDiv(this, "icons boat2");
+ _possibleBoat = ViewUtil.createDiv("icons boat2");
ViewUtil.placeNodeAt(_possibleBoat, _boatStartX, _boatStartY);
_rootNode.nodes.add(_possibleBoat);
_moveListener = handleMouseMove;
@@ -215,21 +215,21 @@ class EnemyGridView extends View {
/** Update the view to indicate a shot that hit an enemy's boat. */
void addHit(int x, int y) {
- Element node = ViewUtil.createDiv(this, "icons hit");
+ Element node = ViewUtil.createDiv("icons hit");
ViewUtil.placeNodeAt(node, x, y);
_rootNode.nodes.add(node);
}
/** Update the view to indicate a shot that missed an enemy's boat. */
void addMiss(int x, int y) {
- Element node = ViewUtil.createDiv(this, "icons miss");
+ Element node = ViewUtil.createDiv("icons miss");
ViewUtil.placeNodeAt(node, x, y);
_rootNode.nodes.add(node);
}
/** Update the view to indicate a shot is in progress. */
void addMaybeHit(int x, int y) {
- Element node = ViewUtil.createDiv(this, "icons maybe-hit");
+ Element node = ViewUtil.createDiv("icons maybe-hit");
ViewUtil.placeNodeAt(node, x, y);
_rootNode.nodes.add(node);
}
@@ -257,7 +257,7 @@ class ShootingStatusView extends View {
ShootingStatusView(this.state, Document doc)
: super(doc) {
- _rootNode = ViewUtil.createDiv(this, "shooting-status");
+ _rootNode = ViewUtil.createDiv("shooting-status");
updateStatus();
}
@@ -296,8 +296,8 @@ class ViewUtil {
}
/** Create a div node with a given class name. */
- static Element createDiv(View view, String className) {
- Element node = view.doc.createElement("div");
+ static Element createDiv(String className) {
+ Element node = new Element.tag("div");
node.attributes["class"] = className;
return node;
}
« no previous file with comments | « client/samples/dartcombat/setup.dart ('k') | client/samples/isolate/IsolateSample.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698