Skip to content

Commit

Permalink
ts compile
Browse files Browse the repository at this point in the history
  • Loading branch information
adi committed Oct 17, 2023
1 parent cafc1f7 commit e34125f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions markdownx/static/markdownx/js/markdownx.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ function getHeight(element) {
function updateHeight(editor) {
// Ensure that the editor is resizable before anything else.
// Change size if scroll is larger that height, otherwise do nothing.
if (editor.scrollTop)
editor.style.height = editor.scrollTop + getHeight(editor) + "px";
editor.style.height = editor.scrollHeight - parseFloat(getComputedStyle(editor).paddingTop) - parseFloat(getComputedStyle(editor).paddingBottom) + "px";
return editor;
}
/**
Expand Down Expand Up @@ -490,7 +489,8 @@ var MarkdownX = function (parent, editor, preview) {
);
xhr.success = function (response) {
properties.preview.innerHTML = response;
properties.editor = updateHeight(properties.editor);
properties.editor = properties._editorIsResizable ?
updateHeight(properties.editor) : properties.editor;
utils_1.triggerCustomEvent('markdownx.update', properties.parent, [response]);
};
xhr.error = function (response) {
Expand Down
Loading

0 comments on commit e34125f

Please sign in to comment.