autosize tag entry
This commit is contained in:
parent
948f3f1bd8
commit
4df1e935b4
1 changed files with 14 additions and 0 deletions
|
@ -6,10 +6,19 @@ function joinUrlSegments(base, query) {
|
|||
return base + separatorChar + query;
|
||||
}
|
||||
|
||||
function autosize(el) {
|
||||
setTimeout(function() {
|
||||
el.style.cssText = 'height:' + el.scrollHeight + 'px';
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function clearViewMode() {
|
||||
document.querySelectorAll('.image_info').forEach((element) => {
|
||||
element.classList.remove('infomode-view');
|
||||
});
|
||||
document.querySelectorAll('.image_info textarea').forEach((el) => {
|
||||
autosize(el);
|
||||
});
|
||||
}
|
||||
|
||||
function updateAttr(selector, attr, value) {
|
||||
|
@ -28,6 +37,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
element.classList.add('infomode-view');
|
||||
});
|
||||
|
||||
document.querySelectorAll('.image_info textarea').forEach((el) => {
|
||||
el.addEventListener('keydown', () => autosize(el));
|
||||
autosize(el);
|
||||
});
|
||||
|
||||
if(document.location.hash.length > 3) {
|
||||
var query = document.location.hash.substring(1);
|
||||
|
||||
|
|
Reference in a new issue