Permalink
Browse files

Remove radio buttons, replace with select.

Languages are now selected using a select element instead of radio buttons.
  • Loading branch information...
1 parent f459da6 commit 8e0bfc5319d2d910ef6c6ff580aaf3de9f90b204 @hdemers committed Feb 28, 2014
Showing with 16 additions and 11 deletions.
  1. +5 −2 birdwtch/static/js/worldmap.js
  2. +11 −9 birdwtch/templates/index.html
@@ -163,15 +163,18 @@ function ($, _, topo, d3) {
};
that.show = function (layer) {
+ // We only allow one language layer to be shown at a time.
+ var code = layer[0].code;
+
// Hide all canvas
$("canvas").hide();
// Hide the dot svg
$("#dotSvg").hide();
- if (layer === "all") {
+ if (code === "all") {
$("#dotSvg").show();
}
- $("#" + layer + "Canvas").show();
+ $("#" + code + "Canvas").show();
};
that.draw();
@@ -27,25 +27,27 @@
the languages of this world. </p>
Explore each language:
- <div data-bind="foreach: languageLayers">
- <div class="radio">
<label>
- <input type="radio" name="layerGroup"
- data-bind="value: code, checked: $root.layerShown" />
- <span data-bind="text:name"></span>
+ <select class="form-control" name="layerGroup"
+ data-bind="
+ options: languageLayers,
+ selectedOptions: layerShown,
+ optionsText: 'name'">
+ </select>
</label>
- </div>
- </div>
</div>
- <div class="col-md-6">
+ </div>
+
+ <div class="row">
+ <div class="col-md-12">
<div class="graph">
<div class="languages"></div>
</div>
</div>
-
</div>
+
<div class="row">
<div class="col-md-12">
<div class="graph">

0 comments on commit 8e0bfc5

Please sign in to comment.