2008-09-27 02:55:58 +02:00
|
|
|
var LSformElement_select = new Class({
|
|
|
|
initialize: function(){
|
|
|
|
this.initialiseLSformElement_select();
|
|
|
|
},
|
|
|
|
|
|
|
|
initialiseLSformElement_select: function() {
|
2008-10-16 15:03:45 +02:00
|
|
|
$$('select.LSformElement_select').each(function(el) {
|
2008-09-27 02:55:58 +02:00
|
|
|
var btn = new Element('img');
|
|
|
|
btn.setProperties({
|
2008-10-09 03:31:33 +02:00
|
|
|
src: varLSdefault.imagePath('clear.png'),
|
2008-09-27 02:55:58 +02:00
|
|
|
alt: 'Reset',
|
|
|
|
title: 'Reset'
|
|
|
|
});
|
|
|
|
btn.addClass('btn');
|
|
|
|
btn.setStyle('vertical-align','top');
|
2008-10-16 15:03:45 +02:00
|
|
|
btn.addEvent('click',this.onClearBtnClick.bind(this,el));
|
2008-09-27 02:55:58 +02:00
|
|
|
btn.injectAfter(el);
|
|
|
|
}, this);
|
|
|
|
},
|
|
|
|
|
2008-10-16 15:03:45 +02:00
|
|
|
onClearBtnClick: function(select) {
|
2008-09-27 02:55:58 +02:00
|
|
|
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();
|
|
|
|
});
|