be1d2d4055f45c3e5b75950b48b61b012d89dbfd
[ldapsaisie.git] / public_html / includes / js / LSformElement_boolean.js
1 var LSformElement_boolean = new Class({
2     initialize: function(){
3       this.initialiseLSformElement_boolean();
4     },
5     
6     initialiseLSformElement_boolean: function() {
7       $$('li.LSformElement_boolean').each(function(el) {
8         var btn = new Element('img');
9         btn.setProperties({
10           src:    varLSdefault.imagePath('clear.png'),
11           alt:    'Clear'
12         });
13         btn.addClass('btn');
14         btn.setStyle('vertical-align','top');
15         btn.addEvent('click',this.onClearBtnClick.bind(this,btn));
16         btn.injectInside(el);
17         varLSdefault.addHelpInfo(btn,'LSformElement_boolean','clear');
18       }, this);
19     },
20     
21     onClearBtnClick: function(btn) {
22       var li = btn.getParent();
23       li.getElements('input').each(function(input) {
24         input.checked=false;
25       },this);
26     }
27 });
28 window.addEvent(window.ie ? 'load' : 'domready', function() {
29   varLSformElement_boolean = new LSformElement_boolean();
30 });