/* * all lowpro behaviors */ CheckBoxToggle = $.klass({ initialize: function(toggle_selector) { this.toggle_selector = toggle_selector; }, onclick: function() { var to_toggle = this.element[0].checked; $(this.toggle_selector + ' input[type=checkbox]').each(function(index) { $(this)[0].checked = to_toggle; }); } }); /* * use like: * * $('.some_category_field').attach(SelectPopper, '#div_with_ul'); * $('#div_with_ul').attach(SetSelector, '.some_category_field'); * */ SelectPopper = $.klass({ // provide array of select_options // TODO: detect a hash and use it to do option text/value initialize: function(select_options) { if(select_options.length > 0) { var _a_ul = $('