mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-28 11:23:49 +01:00
ab7120b589
-> Redimentionnement des dt pour laisser plus de place aux labels - LSformElement_boolean, LSformElement_select : Ajout d'un bouton clear - L'ajout des boutons javascript a été déporté dans le code javascript : -> LSformElement_url -> LSformElement_mail -> LSformElement_rss -> LSformElement_xmp - LSformElement_select_object -> Activation du champ de formulaire directement dans le javascript
34 lines
972 B
JavaScript
34 lines
972 B
JavaScript
var LSformElement_select = new Class({
|
|
initialize: function(){
|
|
this.initialiseLSformElement_select();
|
|
},
|
|
|
|
initialiseLSformElement_select: function() {
|
|
$$('select.LSform').each(function(el) {
|
|
var btn = new Element('img');
|
|
btn.setProperties({
|
|
src: 'templates/images/clear.png',
|
|
alt: 'Reset',
|
|
title: 'Reset'
|
|
});
|
|
btn.addClass('btn');
|
|
btn.setStyle('vertical-align','top');
|
|
btn.addEvent('click',this.onClearBtnClick.bind(this,btn));
|
|
btn.injectAfter(el);
|
|
}, this);
|
|
},
|
|
|
|
onClearBtnClick: function(btn) {
|
|
var select = btn.getPrevious();
|
|
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();
|
|
});
|