ldapsaisie/src/includes/js/LSformElement_textarea.js
Benjamin Renard 7098b3ee79 Massive change of files organisation to move all files outside web-root
The web-root directory now contains URL rewrite stuff. All PHP & static files are
in root src directory and are served via LSurl routes.
2020-05-06 12:17:35 +02:00

33 lines
1,019 B
JavaScript

var LSformElement_textarea = new Class({
initialize: function(){
this.initialiseLSformElement_textarea();
if ($type(varLSform)) {
varLSform.addModule("LSformElement_textarea",this);
}
},
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);
},
onClearBtnClick: function(btn) {
btn.getPrevious('textarea').value='';
},
reinitialize: function(el) {
this.initialiseLSformElement_textarea(el);
}
});
window.addEvent(window.ie ? 'load' : 'domready', function() {
varLSformElement_textarea = new LSformElement_textarea();
});