Use undefined instead of false

pull/201/head
Nick Denry 4 years ago
parent 04ed77f829
commit b23ff6675d

@ -140,7 +140,7 @@ easyMDE.value('New input for **EasyMDE**');
- table - table
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`. - **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"`. - **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`. - **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). - **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`. - **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`.

@ -342,7 +342,7 @@ function toggleFullScreen(editor) {
} }
// Remove or set maxHeight // Remove or set maxHeight
if (editor.options.maxHeight !== false) { if (typeof editor.options.maxHeight !== 'undefined') {
if (cm.getOption('fullScreen')) { if (cm.getOption('fullScreen')) {
cm.getScrollerElement().style.removeProperty('height'); cm.getScrollerElement().style.removeProperty('height');
sidebyside.style.removeProperty('height'); sidebyside.style.removeProperty('height');
@ -1719,7 +1719,7 @@ function EasyMDE(options) {
options.shortcuts = extend({}, shortcuts, options.shortcuts || {}); options.shortcuts = extend({}, shortcuts, options.shortcuts || {});
options.minHeight = options.minHeight || '300px'; options.minHeight = options.minHeight || '300px';
options.maxHeight = options.maxHeight || false; options.maxHeight = options.maxHeight || undefined;
options.errorCallback = options.errorCallback || function (errorMessage) { options.errorCallback = options.errorCallback || function (errorMessage) {
alert(errorMessage); alert(errorMessage);
@ -2007,7 +2007,7 @@ EasyMDE.prototype.render = function (el) {
this.codemirror.getScrollerElement().style.minHeight = options.minHeight; this.codemirror.getScrollerElement().style.minHeight = options.minHeight;
if (options.maxHeight !== false) { if (typeof options.maxHeight !== 'undefined') {
this.codemirror.getScrollerElement().style.height = options.maxHeight; this.codemirror.getScrollerElement().style.height = options.maxHeight;
} }
@ -2328,7 +2328,7 @@ EasyMDE.prototype.createSideBySide = function () {
wrapper.parentNode.insertBefore(preview, wrapper.nextSibling); wrapper.parentNode.insertBefore(preview, wrapper.nextSibling);
} }
if (this.options.maxHeight !== false) { if (typeof this.options.maxHeight !== 'undefined') {
this.setPreviewMaxHeight(); this.setPreviewMaxHeight();
} }

@ -165,7 +165,6 @@ const editorImagesCustom = new EasyMDE({
new EasyMDE({ new EasyMDE({
sideBySideFullscreen: true, sideBySideFullscreen: true,
maxHeight: false,
autosave: { autosave: {
enabled: true, enabled: true,
delay: 2000, delay: 2000,

@ -172,7 +172,7 @@ declare namespace EasyMDE {
insertTexts?: InsertTextOptions; insertTexts?: InsertTextOptions;
lineWrapping?: boolean; lineWrapping?: boolean;
minHeight?: string; minHeight?: string;
maxHeight?: boolean | string; maxHeight?: string;
parsingConfig?: ParsingOptions; parsingConfig?: ParsingOptions;
placeholder?: string; placeholder?: string;
previewClass?: string | ReadonlyArray<string>; previewClass?: string | ReadonlyArray<string>;

Loading…
Cancel
Save