diff options
author | Manolo Carrasco <manolo@apache.org> | 2010-08-06 18:58:32 +0000 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2010-08-06 18:58:32 +0000 |
commit | ea9f7dd0fdeb2a06173e7d1ab1cabed8383f051b (patch) | |
tree | 3aa7b04be4967d1c1e7bd78848143ab2c17fd011 /samples | |
parent | 3d417bda9261d9d50e9cac9258fbf9f271c88808 (diff) | |
download | gwtquery-ea9f7dd0fdeb2a06173e7d1ab1cabed8383f051b.tar.gz gwtquery-ea9f7dd0fdeb2a06173e7d1ab1cabed8383f051b.zip |
update demos
Diffstat (limited to 'samples')
-rw-r--r-- | samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java | 24 | ||||
-rw-r--r-- | samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html | 1 |
2 files changed, 20 insertions, 5 deletions
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java index 46b31977..a3d180ec 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java @@ -92,7 +92,7 @@ public class GwtQueryBenchModule implements EntryPoint { }
/**
- * Benchmark for others dynamic selectors
+ * Benchmark for other dynamic selectors
*/
private class GQueryDynamicBenchmark implements Benchmark {
@@ -269,12 +269,22 @@ public class GwtQueryBenchModule implements EntryPoint { });
}
};
+
+ private static native String showCapabilities() /*-{
+ return window + " " + $wnd + " " + document.querySelectorAll + " " + $doc.querySelectorAll;
+ }-*/;
/**
* EntryPoint
*/
public void onModuleLoad() {
+
+
final MySelectors m = GWT.create(MySelectors.class);
+
+ System.out.println(showCapabilities());
+ System.out.println($("body"));
+
dg = m.getAllSelectors();
String par = Window.Location.getParameter("min");
@@ -412,11 +422,17 @@ public class GwtQueryBenchModule implements EntryPoint { g.append($(s));
}
- int height = Math.max(35, g.find(".horse").height() * (benchs.length + 1));
+ GQuery flag = $("<img class=flag src='images/bench/animated-flag.gif'/>").appendTo(document);
+
+ // These values are set in the css.
+ int horseHeight = 35;
+ int horseWidth = 150;
+ int flagWidth = 35;
+
+ int height = horseHeight * (benchs.length + 1);
$("#racetrack").css("height", height + "px");
- GQuery flag = $("<img class=flag src='images/bench/animated-flag.gif'/>").appendTo(document);
- trackWidth = g.width() - g.find(".horse").width() - flag.width();
+ trackWidth = g.width() - horseWidth - flagWidth;
flag.hide();
}
diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html b/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html index 29843ef7..f876b44c 100644 --- a/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html +++ b/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html @@ -24,7 +24,6 @@ color: black;
background: #808080;
border: 2px solid #936630;
- padding: 20px;
width: 200px;
}
|