Permalink
Browse files

Fixing experiment alternative highlighting.

  • Loading branch information...
1 parent 9f7e276 commit 11ccb1d32b58ed5dcf21a9f99e30142e56c4cbcb @matthewhudson matthewhudson committed Apr 12, 2013
Showing with 7 additions and 5 deletions.
  1. +5 −3 sixpack/static/js/chart.js
  2. +1 −1 sixpack/templates/dashboard.html
  3. +1 −1 sixpack/templates/details.html
@@ -78,7 +78,7 @@ $(function () {
my.drawLine = function (data, color) {
color = color || "#9d5012";
- var line_id = "line-" + _.indexOf(my.colors, color);
+ var line_id = my.experiment + "-line-" + _.indexOf(my.colors, color);
var line = d3.svg.line()
.x(function (d) {
return my.xScale(d.date);
@@ -99,8 +99,10 @@ $(function () {
.on("mouseover", function (d) {
var currClass = d3.select(this).attr("class");
d3.select(this).attr("class", currClass + " line-hover");
- $('.' + d3.event.target.id).closest('table').find('tr').removeClass('highlight');
- $('.' + d3.event.target.id).addClass('highlight');
+
+ var table = $('.' + d3.event.target.id).closest('div').find('table')
+ table.find('tr').removeClass('highlight');
+ table.find('.' + d3.event.target.id).addClass('highlight');
my.tooltip.html(d.date + "<br/>" + d.close)
.style("left", (d3.event.pageX) + "px")
@@ -41,7 +41,7 @@ <h3 class="name">
<th>Confidence</th>
</tr>
<% _.each(experiment.alternatives, function (alt, index) { %>
- <tr class="line-<%- index %>">
+ <tr class="<%- experiment.name %>-line-<%- index %>">
<td>
<span class="circle color-<%- (index + 1) %>">
<% if (alt.is_winner) { %>
@@ -55,7 +55,7 @@ <h3 class="name">
<th>Winner</th>
</tr>
<% _.each(experiment.alternatives, function (alt, index) { %>
- <tr class="line-<%- index %>">
+ <tr class="<%- experiment.name %>-line-<%- index %>">
<td>
<span class="circle color-<%- (index + 1) %>">
<% if (alt.is_winner) { %>

0 comments on commit 11ccb1d

Please sign in to comment.