From 32e097148326833ff195bc4e12471b328472cfdf Mon Sep 17 00:00:00 2001 From: Nick Denry Date: Fri, 7 Aug 2020 23:41:56 +0300 Subject: [PATCH 1/2] Fix maxHeight less than minHeight --- src/js/easymde.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index bfa1a7b..4c057e1 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -1718,9 +1718,14 @@ function EasyMDE(options) { // Merging the shortcuts, with the given options options.shortcuts = extend({}, shortcuts, options.shortcuts || {}); - options.minHeight = options.minHeight || '300px'; options.maxHeight = options.maxHeight || undefined; + if (typeof options.maxHeight !== 'undefined') { + options.minHeight = options.maxHeight; // Min and max height are equal if maxHeight is set + } else { + options.minHeight = options.minHeight || '300px'; + } + options.errorCallback = options.errorCallback || function (errorMessage) { alert(errorMessage); }; From 065a022644f94c4a384887ebc710df290cb9b319 Mon Sep 17 00:00:00 2001 From: Nick Denry Date: Fri, 7 Aug 2020 23:46:51 +0300 Subject: [PATCH 2/2] Fix comment --- src/js/easymde.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index 4c057e1..969e30d 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -1721,7 +1721,8 @@ function EasyMDE(options) { options.maxHeight = options.maxHeight || undefined; if (typeof options.maxHeight !== 'undefined') { - options.minHeight = options.maxHeight; // Min and max height are equal if maxHeight is set + // Min and max height are equal if maxHeight is set + options.minHeight = options.maxHeight; } else { options.minHeight = options.minHeight || '300px'; }