aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2010-08-01 08:40:41 +0000
committerManolo Carrasco <manolo@apache.org>2010-08-01 08:40:41 +0000
commit62bce3f9d42145a6be0e2789de4a678fb536d688 (patch)
tree02a79b19135899659ab371437b3caa3b7f9dd1ad /samples
parent8555389edbc57ff231c47e69790602d734a4ed89 (diff)
downloadgwtquery-62bce3f9d42145a6be0e2789de4a678fb536d688.tar.gz
gwtquery-62bce3f9d42145a6be0e2789de4a678fb536d688.zip
Hide start race button while iframes are loading
Diffstat (limited to 'samples')
-rw-r--r--samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java10
-rw-r--r--samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html3
2 files changed, 9 insertions, 4 deletions
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java
index b79d2cc9..46b31977 100644
--- a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java
+++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java
@@ -189,6 +189,7 @@ public class GwtQueryBenchModule implements EntryPoint {
selectedBenchmarks = readBenchmarkSelection();
selectPanel.hide();
$("#startrace").hide();
+ $("#results").show();
initResultsTable(dg, selectedBenchmarks);
initTrack(selectedBenchmarks);
@@ -300,8 +301,8 @@ public class GwtQueryBenchModule implements EntryPoint {
initSelects(benchmarks);
initIFrames();
+ $("#results").hide();
- $("#startrace").click(ask ? askBenchMarks: runBenchMarks);
}
private void d(int selnumber, int benchnumber, String text) {
@@ -337,11 +338,16 @@ public class GwtQueryBenchModule implements EntryPoint {
} else {
$(i.replaceAll("%ID%", "iframe")).appendTo(document).hide();
}
+
+ $("#startrace").text("Loading ...");
// Wait a while until the iframe/s have been loaded
new Timer() {
public void run() {
writeTestContent($(".ibench").contents().find("body").get(0));
gwtiframe = $(".ibench").eq(0).contents().get(0);
+ $("#startrace").text("Start Race");
+ $("#startrace").click(ask ? askBenchMarks: runBenchMarks);
+
}
}.schedule(waitToLoad);
}
@@ -406,7 +412,7 @@ public class GwtQueryBenchModule implements EntryPoint {
g.append($(s));
}
- int height = g.find(".horse").height() * (benchs.length + 1);
+ int height = Math.max(35, g.find(".horse").height() * (benchs.length + 1));
$("#racetrack").css("height", height + "px");
GQuery flag = $("<img class=flag src='images/bench/animated-flag.gif'/>").appendTo(document);
diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html b/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html
index b2a7cc08..29843ef7 100644
--- a/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html
+++ b/samples/src/main/java/gwtquery/samples/public/GwtQueryBench.html
@@ -72,9 +72,8 @@
<body>
<h2 style="color: white; border-bottom: 1px solid gray">
GWTSpeed - GWT Query benchmarks
- <div id="startrace" style="float: right; color: red">Start Race</div>
</h2>
-
+ <div id="startrace" style="color: red"></div>
<div id="racetrack" style="height: 0px; overflow: hidden;">
<div id="racefield"
style="height: 100%; padding: 15px; background-image: url(images/bench/grass-texture-small.jpg); background-repeat: repeat;">