diff options
author | Ray Cromwell <cromwellian@gmail.com> | 2009-05-15 00:47:33 +0000 |
---|---|---|
committer | Ray Cromwell <cromwellian@gmail.com> | 2009-05-15 00:47:33 +0000 |
commit | 5b0a27c6fb403b5a5563d433b5881f61bfce60c5 (patch) | |
tree | b1b82097d95b8e57843af3b316852dafeb48b0c4 | |
parent | 67086efa4ae77fee844703ae4af9b30001d624cb (diff) | |
download | gwtquery-5b0a27c6fb403b5a5563d433b5881f61bfce60c5.tar.gz gwtquery-5b0a27c6fb403b5a5563d433b5881f61bfce60c5.zip |
Tweaks to horserace
-rw-r--r-- | samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java | 8 | ||||
-rw-r--r-- | samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java index 55355a35..c503d3c6 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java @@ -6,9 +6,9 @@ import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element;
import com.google.gwt.query.client.DeferredGQuery;
import com.google.gwt.query.client.SelectorEngine;
+import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.DOM;
public class GwtQueryBenchModule implements EntryPoint {
@@ -77,7 +77,7 @@ public class GwtQueryBenchModule implements EntryPoint { for (int i = 0; i < benchmark.length; i++) {
if (i != winner) {
moveHorse(benchmark[i].getId(),
- (int) (totalMovement * (double)(winTime
+ (int) (totalMovement * (double) (winTime
/ (double) runTimes[i])));
setResultClass(benchmark[i].getId(), selectorNumber, "lose");
}
@@ -148,6 +148,7 @@ public class GwtQueryBenchModule implements EntryPoint { Element td = Document.get().getElementById(type + i);
td.setInnerHTML(
"" + (((int) (v * 100)) / 100.0) + " ms, found " + i1 + " nodes");
+ DOM.scrollIntoView((com.google.gwt.user.client.Element) td);
}
private void initResultsTable(DeferredGQuery[] dg, String... options) {
@@ -155,6 +156,7 @@ public class GwtQueryBenchModule implements EntryPoint { Document doc = Document.get();
Element table = doc.getElementById("resultstable");
Element thead = doc.createTHeadElement();
+// thead.getStyle().setProperty("position", "relative");
table.appendChild(thead);
Element selectorHeader = doc.createTHElement();
Element theadtr = doc.createTRElement();
@@ -163,6 +165,8 @@ public class GwtQueryBenchModule implements EntryPoint { thead.appendChild(theadtr);
Element tbody = doc.createTBodyElement();
+// tbody.getStyle().setProperty("overflow", "scroll");
+// tbody.getStyle().setProperty("height", "200px");
table.appendChild(tbody);
for (int i = 0; i < options.length; i += 2) {
diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html b/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html index ada6fc3d..9b4218a0 100644 --- a/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html +++ b/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html @@ -45,7 +45,7 @@ <iframe id="prototypebench" src="prototypebench.html" style="display: none"></iframe>
<code style="display: block; height: 200px; width:780px; overflow-y:scroll">
-<table id="resultstable" border="1" style="width: 780px; border-collapse: collapse; height: 200px">
+<table id="resultstable" border="1" style="width: 780px; border-collapse: collapse">
</table>
</code>
|