Skip to content
Browse files

Highlight selected check for plot and listen on click event

  • Loading branch information...
1 parent 22b655b commit 114193fed566ac104edc9916223bb552b6e39da6 @jarus jarus committed Mar 11, 2013
Showing with 11 additions and 7 deletions.
  1. +10 −6 krprj/worshipmap/static/lib/kirchenreich/dashboard.js
  2. +1 −1 krprj/worshipmap/templates/dashboard.html
View
16 krprj/worshipmap/static/lib/kirchenreich/dashboard.js
@@ -34,14 +34,17 @@ kr.plot.pie = function(target, data) {
});
};
-kr.plot.onCheckHover = function(event, check){
- var _data;
+kr.plot.onCheckSelect = function(event, check){
if (check === undefined) {
- _data = $(this).data();
+ check = $(this);
} else {
- _data = $(check).data();
+ check = $(check);
}
+ $("tr.kr_check").removeClass("info");
+ check.addClass("info");
+
+ var _data = check.data();
var data = [{
label: 'Reached',
data: _data.reached,
@@ -55,7 +58,8 @@ kr.plot.onCheckHover = function(event, check){
};
$(document).ready(function() {
- $("tr.kr_check").hover(kr.plot.onCheckHover);
- kr.plot.onCheckHover({}, $("tr.kr_check").first());
+ $("tr.kr_check").hover(kr.plot.onCheckSelect);
+ $("tr.kr_check").click(kr.plot.onCheckSelect);
+ kr.plot.onCheckSelect({}, $("tr.kr_check").first());
});
View
2 krprj/worshipmap/templates/dashboard.html
@@ -123,7 +123,7 @@
<tr class="kr_check" data-reached="{{ check.reached }}" data-pending="{{ check.pending }}">
<td>{{ check.description }}</td>
<td>{{ check.reached|intcomma }}</td>
- <td>{{ check.percent_reached}}%</td>
+ <td><strong>{{ check.percent_reached}}%</strong></td>
</tr>
{% endfor %}
</tbody>

0 comments on commit 114193f

Please sign in to comment.
Something went wrong with that request. Please try again.