151 - Make the editor bigger and autosize it
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
function autosize(){
|
||||
const el = this;
|
||||
el.style.height = 'auto';
|
||||
el.style.height = (el.scrollHeight ) + 'px';
|
||||
}
|
||||
|
||||
const articleContent = document.querySelector('#content');
|
||||
let offset = 0;
|
||||
let style = window.getComputedStyle(articleContent, null);
|
||||
|
||||
offset += parseInt(style['paddingTop']) + parseInt(style['paddingBottom']);
|
||||
autosize.bind(articleContent)();
|
||||
articleContent.addEventListener('keyup', autosize);
|
||||
|
||||
@@ -422,6 +422,9 @@ form.new-post .title {
|
||||
}
|
||||
form.new-post textarea {
|
||||
min-height: 20em;
|
||||
overflow-y: hidden;
|
||||
resize: none;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
form.new-post input[type="submit"] {
|
||||
background: #ECECEC;
|
||||
|
||||
Reference in New Issue
Block a user