autosize tag entry
This commit is contained in:
@ -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 New Issue
Block a user