ldapsaisie/trunk/includes/js/LSformElement_select.js
Benjamin Renard 6143be5488 - LSformElement_select : Refonte en utilisant les templates
- LSformElement_password : Ajout d'un fichier oublié dans le dernier commit
2008-10-16 13:03:45 +00:00

33 lines
957 B
JavaScript

var LSformElement_select = new Class({
initialize: function(){
this.initialiseLSformElement_select();
},
initialiseLSformElement_select: function() {
$$('select.LSformElement_select').each(function(el) {
var btn = new Element('img');
btn.setProperties({
src: varLSdefault.imagePath('clear.png'),
alt: 'Reset',
title: 'Reset'
});
btn.addClass('btn');
btn.setStyle('vertical-align','top');
btn.addEvent('click',this.onClearBtnClick.bind(this,el));
btn.injectAfter(el);
}, this);
},
onClearBtnClick: function(select) {
this.resetSelect(select);
},
resetSelect: function(select) {
for(var i=0;i<select.length;i++) {
select[i].selected=false;
}
}
});
window.addEvent(window.ie ? 'load' : 'domready', function() {
varLSformElement_select = new LSformElement_select();
});