From 296b0ee628bd07920db79efa892740d7e5f89940 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 21 May 2010 19:50:56 +0200 Subject: [PATCH] update checked-count via javascript --- templates/all_checkboxes.html.ep | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/templates/all_checkboxes.html.ep b/templates/all_checkboxes.html.ep index 0e46343..11cfbe9 100644 --- a/templates/all_checkboxes.html.ep +++ b/templates/all_checkboxes.html.ep @@ -21,18 +21,30 @@ $('label span.hint').position({ $('a#all').click( function(){ $("input[type='checkbox']:not([disabled='disabled'])").attr('checked', true); + $('#checked-count').text( $('#facet-count').text() ); }); $('a#none').click( function(){ $("input[type='checkbox']:not([disabled='disabled'])").attr('checked', false); + $('#checked-count').text( '-' ); }); $('a#included').click( function(){ - $("label.included input[type='checkbox']:not([disabled='disabled'])").attr('checked', true); + var count = 0; + $("label.included input[type='checkbox']:not([disabled='disabled'])").each( function() { + this.checked = true; + count++; + }); + $('#checked-count').text( count ); }).hide(); $('a#excluded').click( function(){ - $("label.excluded input[type='checkbox']:not([disabled='disabled'])").attr('checked', true); + var count = 0; + $("label.excluded input[type='checkbox']:not([disabled='disabled'])").each( function() { + this.checked = true; + count++; + }); + $('#checked-count').text( count ); }).hide(); $('input[name=filter_regex]').change( function(e) { -- 2.20.1