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({
|
2013-06-19 02:17:39 +02:00
|
|
|
src: varLSdefault.imagePath('clear'),
|
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);
|
2008-11-10 04:14:13 +01:00
|
|
|
varLSdefault.addHelpInfo(btn,'LSformElement_select','clear');
|
2008-09-27 02:55:58 +02:00
|
|
|
}, 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) {
|
2012-05-16 15:18:40 +02:00
|
|
|
if ($type(select)!='select') {
|
|
|
|
select=select.getParent('select');
|
|
|
|
}
|
2008-11-14 18:04:39 +01:00
|
|
|
select.selectedIndex=-1;
|
2008-09-27 02:55:58 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
window.addEvent(window.ie ? 'load' : 'domready', function() {
|
|
|
|
varLSformElement_select = new LSformElement_select();
|
|
|
|
});
|