Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Highlight selected check for plot and listen on click event

  • Loading branch information...
commit 114193fed566ac104edc9916223bb552b6e39da6 1 parent 22b655b
@jarus jarus authored
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>
Please sign in to comment.
Something went wrong with that request. Please try again.