projects
/
MojoFacets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a2d116
)
added toggle to checkboxes
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 24 May 2010 19:54:28 +0000
(21:54 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 24 May 2010 19:54:28 +0000
(21:54 +0200)
templates/all_checkboxes.html.ep
patch
|
blob
|
history
diff --git
a/templates/all_checkboxes.html.ep
b/templates/all_checkboxes.html.ep
index
1300336
..
0d2d5e7
100644
(file)
--- a/
templates/all_checkboxes.html.ep
+++ b/
templates/all_checkboxes.html.ep
@@
-1,4
+1,5
@@
<a id="all" href="#">all</a>
+<a id="toggle" href="#">toggle</a>
<a id="none" href="#">none</a>
<label for=filter_regex>regex:
@@
-29,6
+30,15
@@
$('a#none').click( function(){
$('#checked-count').text( 0 );
});
+$('a#toggle').click( function(){
+ var count = 0;
+ $("input[type='checkbox']:not([disabled='disabled'])").each( function() {
+ this.checked = ! this.checked;
+ if ( this.checked ) count++;
+ });
+ $('#checked-count').text( count );
+});
+
function update_checked_count(full) {
var count = $('#checked-count');
var nr = -1;