summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace>2013-05-27 02:54:11 +1200
committerFreeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace>2013-05-27 02:54:11 +1200
commit751f746d817ce8059d87afbb365d3b340cad9d7c (patch)
tree47eb6f96b9de556f19ec49ec9db82d6c12088ca4
parentdff6bad7c5fde8188d4cb59a597bb93b6baf9ff2 (diff)
downloadmanavis-751f746d817ce8059d87afbb365d3b340cad9d7c.tar.gz
manavis-751f746d817ce8059d87afbb365d3b340cad9d7c.tar.bz2
manavis-751f746d817ce8059d87afbb365d3b340cad9d7c.tar.xz
manavis-751f746d817ce8059d87afbb365d3b340cad9d7c.zip
Disable controls until init has finished
Before, if you were quick or your connection was slow, you could select the files before mv.init registers the callback. This left things stuck, either requiring another set of files to be selected, or a refresh of the page. This closes #18.
-rw-r--r--public/css/style.css8
-rw-r--r--public/index.html4
-rw-r--r--public/js/mv/main.js3
3 files changed, 13 insertions, 2 deletions
diff --git a/public/css/style.css b/public/css/style.css
index f0b7c02..4d7299e 100644
--- a/public/css/style.css
+++ b/public/css/style.css
@@ -289,3 +289,11 @@ a:hover {
border-top-color: #1b435e;
background: #1b435e;
}
+
+.disabled-button, .disabled-button:hover, .disabled-button:active {
+ border-top: 1px solid #999;
+ background: #777;
+ text-decoration: none;
+ color: white;
+}
+
diff --git a/public/index.html b/public/index.html
index e3ad3c3..f51f8b7 100644
--- a/public/index.html
+++ b/public/index.html
@@ -76,9 +76,9 @@
<p>You can load any number of files at once.</p>
<p>Please note that this is very js intensive. The tab may briefly lock up as it loads everything.</p>
<div>
- <input type="file" id="input" name="records[]" multiple />
+ <input type="file" id="input" name="records[]" multiple disabled />
<output id="list"></output>
- or <a href="javascript:mv.loader.use(['/logs/map.scrubbed.latest.zip']);" class="button">Use the most recent dataset</a>
+ or <a id="latest-link" href="javascript:mv.loader.use(['/logs/map.scrubbed.latest.zip']);" class="button disabled-button">Use the most recent dataset</a>
</div>
<div id="filesbar" class="progressbar fader">
<div class="percent">0%</div>
diff --git a/public/js/mv/main.js b/public/js/mv/main.js
index b5a2b3a..8d7a660 100644
--- a/public/js/mv/main.js
+++ b/public/js/mv/main.js
@@ -31,6 +31,9 @@ var mv = function(mv) {
mv.loader.setname = function(n) { name = n; };
/* Set zip.js worker path */
zip.workerScriptsPath = "/js/zip/WebContent/";
+ /* Init done! Enable controls. */
+ document.getElementById("input").disabled = false;
+ d3.select("#latest-link").attr("class", "button");
};
/* When a file has finished loading, handle it. */
function handleFile(data, name, after) {