fix(mail(js)): use initial number of rows of textarea with sgAutogrow
parent
d39208efa0
commit
200c353645
|
@ -29,6 +29,7 @@
|
||||||
if (!scope.autogrow) return;
|
if (!scope.autogrow) return;
|
||||||
|
|
||||||
var textarea = elem[0];
|
var textarea = elem[0];
|
||||||
|
var minHeight = textarea.clientHeight;
|
||||||
var hiddenDiv = $document[0].createElement('div');
|
var hiddenDiv = $document[0].createElement('div');
|
||||||
var content = null;
|
var content = null;
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
hiddenDiv.innerHTML = content + '<br style="line-height: 3px;">';
|
hiddenDiv.innerHTML = content + '<br style="line-height: 3px;">';
|
||||||
hiddenDiv.style.visibility = 'hidden';
|
hiddenDiv.style.visibility = 'hidden';
|
||||||
hiddenDiv.style.display = 'block';
|
hiddenDiv.style.display = 'block';
|
||||||
textarea.style.height = hiddenDiv.offsetHeight + 'px';
|
textarea.style.height = Math.max(minHeight, hiddenDiv.offsetHeight) + 'px';
|
||||||
hiddenDiv.style.visibility = 'visible';
|
hiddenDiv.style.visibility = 'visible';
|
||||||
hiddenDiv.style.display = 'none';
|
hiddenDiv.style.display = 'none';
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue