This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
rangitaki/rcc/res/rcc.js
mmk2410 c242062cd9 Various Improvements:
- Metatags based on subblog and/or article
 - Drawer close button
 - RCC: media upload
 - RCC subpages: back button
2015-11-22 00:59:07 +01:00

20 lines
No EOL
683 B
JavaScript

window.onload = function () {
var t = document.getElementsByTagName('textarea')[0];
var offset = !window.opera ? (t.offsetHeight - t.clientHeight) : (t.offsetHeight + parseInt(window.getComputedStyle(t, null).getPropertyValue('border-top-width')));
/**
* The following three code clocks are for proper resizing of the input textarea
*/
var resize = function (t) {
t.style.height = 'auto';
t.style.height = (t.scrollHeight + offset ) + 'px';
}
t.addEventListener && t.addEventListener('input', function (event) {
resize(t);
});
t['attachEvent'] && t.attachEvent('onkeyup', function () {
resize(t);
});
}