ldapsaisie/src/includes/js/LSformElement_textarea.js

34 lines
1,019 B
JavaScript
Raw Normal View History

var LSformElement_textarea = new Class({
initialize: function(){
this.initialiseLSformElement_textarea();
if ($type(varLSform)) {
varLSform.addModule("LSformElement_textarea",this);
}
},
2020-04-29 15:54:21 +02:00
initialiseLSformElement_textarea: function(el) {
if (!$type(el)) {
el = document;
}
el.getElements('textarea.LSform').each(function(textarea) {
var btn = new Element('img');
btn.addClass('btn');
btn.src = varLSdefault.imagePath('clear');
btn.addEvent('click',this.onClearBtnClick.bind(this,btn));
btn.injectAfter(textarea);
varLSdefault.addHelpInfo(btn,'LSformElement_textarea','clear');
}, this);
},
2020-04-29 15:54:21 +02:00
onClearBtnClick: function(btn) {
btn.getPrevious('textarea').value='';
},
2020-04-29 15:54:21 +02:00
reinitialize: function(el) {
this.initialiseLSformElement_textarea(el);
}
});
window.addEvent(window.ie ? 'load' : 'domready', function() {
varLSformElement_textarea = new LSformElement_textarea();
});