projects
/
MojoFacets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make column selection options at fixed position
[MojoFacets.git]
/
templates
/
all_checkboxes.html.ep
diff --git
a/templates/all_checkboxes.html.ep
b/templates/all_checkboxes.html.ep
index
7c2b16f
..
89991e3
100644
(file)
--- a/
templates/all_checkboxes.html.ep
+++ b/
templates/all_checkboxes.html.ep
@@
-1,12
+1,15
@@
+<span id=column_selection>
<a id="all" href="#">all</a>
<a id="all" href="#">all</a>
+<a id="toggle" href="#">toggle</a>
<a id="none" href="#">none</a>
<label for=filter_regex>regex:
<input type=text name=filter_regex>
<span class=hint>tab or click outside to apply</span>
<a id="none" href="#">none</a>
<label for=filter_regex>regex:
<input type=text name=filter_regex>
<span class=hint>tab or click outside to apply</span>
-<a id="included" href="#">included</a>
-<a id="excluded" href="#">excluded</a>
+<a id="included" href="#"
style="display:none"
>included</a>
+<a id="excluded" href="#"
style="display:none"
>excluded</a>
</label>
</label>
+</span>
<script type="text/javascript">
<script type="text/javascript">
@@
-29,6
+32,15
@@
$('a#none').click( function(){
$('#checked-count').text( 0 );
});
$('#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;
function update_checked_count(full) {
var count = $('#checked-count');
var nr = -1;
@@
-47,17
+59,21
@@
function update_checked_count(full) {
$("input[type='checkbox']").bind( 'click', update_checked_count );
$("input[type='checkbox']").bind( 'click', update_checked_count );
+var toggle_checkbox = function() {
+ this.checked = ! this.checked;
+};
+
$('a#included').click( function(){
$('a#included').click( function(){
- $("label.included input[type='checkbox']:not([disabled='disabled'])").
attr('checked', true
);
+ $("label.included input[type='checkbox']:not([disabled='disabled'])").
each( toggle_checkbox
);
update_checked_count(1);
update_checked_count(1);
-})
.hide()
;
+});
$('a#excluded').click( function(){
$('a#excluded').click( function(){
- $("label.excluded input[type='checkbox']:not([disabled='disabled'])").
attr('checked', false
);
+ $("label.excluded input[type='checkbox']:not([disabled='disabled'])").
each( toggle_checkbox
);
update_checked_count(1);
update_checked_count(1);
-})
.hide()
;
+});
-$('input[name=filter_regex]').
change
( function(e) {
+$('input[name=filter_regex]').
focusout
( function(e) {
console.debug( this, e );
var r = new RegExp( this.value ,'i');
var included = 0;
console.debug( this, e );
var r = new RegExp( this.value ,'i');
var included = 0;