diff --git a/README.md b/README.md index 2dbeb43..451c3c0 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ easyMDE.value('New input for **EasyMDE**'); - table - **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`. - **minHeight**: Sets the minimum height for the composition area, before it starts auto-growing. Should be a string containing a valid CSS value like `"500px"`. Defaults to `"300px"`. -- **maxHeight**: Sets fixed height for the composition area. `minHeight` option will be ignored. Should be a string containing a valid CSS value like `"500px"`. Defaults to `false`. +- **maxHeight**: Sets fixed height for the composition area. `minHeight` option will be ignored. Should be a string containing a valid CSS value like `"500px"`. Defaults to `undefined`. - **onToggleFullScreen**: A function that gets called when the editor's full screen mode is toggled. The function will be passed a boolean as parameter, `true` when the editor is currently going into full screen mode, or `false`. - **parsingConfig**: Adjust settings for parsing the Markdown during editing (not previewing). - **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`. diff --git a/src/js/easymde.js b/src/js/easymde.js index 0587b91..e5bba82 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -342,7 +342,7 @@ function toggleFullScreen(editor) { } // Remove or set maxHeight - if (editor.options.maxHeight !== false) { + if (typeof editor.options.maxHeight !== 'undefined') { if (cm.getOption('fullScreen')) { cm.getScrollerElement().style.removeProperty('height'); sidebyside.style.removeProperty('height'); @@ -1719,7 +1719,7 @@ function EasyMDE(options) { options.shortcuts = extend({}, shortcuts, options.shortcuts || {}); options.minHeight = options.minHeight || '300px'; - options.maxHeight = options.maxHeight || false; + options.maxHeight = options.maxHeight || undefined; options.errorCallback = options.errorCallback || function (errorMessage) { alert(errorMessage); @@ -2007,7 +2007,7 @@ EasyMDE.prototype.render = function (el) { this.codemirror.getScrollerElement().style.minHeight = options.minHeight; - if (options.maxHeight !== false) { + if (typeof options.maxHeight !== 'undefined') { this.codemirror.getScrollerElement().style.height = options.maxHeight; } @@ -2328,7 +2328,7 @@ EasyMDE.prototype.createSideBySide = function () { wrapper.parentNode.insertBefore(preview, wrapper.nextSibling); } - if (this.options.maxHeight !== false) { + if (typeof this.options.maxHeight !== 'undefined') { this.setPreviewMaxHeight(); } diff --git a/types/easymde-test.ts b/types/easymde-test.ts index 538d9a5..32239db 100644 --- a/types/easymde-test.ts +++ b/types/easymde-test.ts @@ -165,7 +165,6 @@ const editorImagesCustom = new EasyMDE({ new EasyMDE({ sideBySideFullscreen: true, - maxHeight: false, autosave: { enabled: true, delay: 2000, diff --git a/types/easymde.d.ts b/types/easymde.d.ts index d26b640..b4c8045 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -172,7 +172,7 @@ declare namespace EasyMDE { insertTexts?: InsertTextOptions; lineWrapping?: boolean; minHeight?: string; - maxHeight?: boolean | string; + maxHeight?: string; parsingConfig?: ParsingOptions; placeholder?: string; previewClass?: string | ReadonlyArray;