Make group name as link in home screen
Benjamin Renard

Benjamin Renard commited on 2014-01-12 22:24:22
Showing 1 changed files, with 7 additions and 1 deletions.

... ...
@@ -101,9 +101,15 @@ view_home=function() {
101 101
           sum+=value;
102 102
           diff='<td class="positive">+'+value.toFixed(2)+' €</td>';
103 103
         }
104
-        tbody.html(tbody.html()+'<tr><td>'+g+'</td>'+diff+'</tr>');
104
+        tbody.html(tbody.html()+'<tr><td><a class="group-link">'+g+'</a></td>'+diff+'</tr>');
105 105
       }
106 106
     }
107
+    $('#view-home #mybalances a.group-link').bind('click',function(e) {
108
+      g=$(e.target).html();
109
+      if (jQuery.type(groups[g])!='undefined') {
110
+        view_group(groups[g]);
111
+      }
112
+    });
107 113
     if (sum<0) {
108 114
       $('#view-home #mybalances #total-value').html('<span class="negative">'+sum.toFixed(2)+' €</span>');
109 115
     }
110 116