diff --git a/CHANGELOG.md b/CHANGELOG.md index b394237..4d01a35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ All notable changes to easymde will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - +## [Unreleased] +### Changed +- Set `previewImagesInEditor` option to `false` by default ([#251]). + ## [2.12.0] - 2020-09-29 ### Added - `this` context in imageUploadFunction (Thanks to [@JoshuaLicense], [#225]). @@ -167,6 +170,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown - Cursor not always showing in "text" mode over the edit field +[#251]: https://github.com/Ionaru/easy-markdown-editor/issues/251 [#239]: https://github.com/Ionaru/easy-markdown-editor/issues/239 [#178]: https://github.com/Ionaru/easy-markdown-editor/issues/178 [#136]: https://github.com/Ionaru/easy-markdown-editor/issues/136 diff --git a/src/js/easymde.js b/src/js/easymde.js index a99e29d..12fd370 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -1991,7 +1991,7 @@ EasyMDE.prototype.render = function (el) { CodeMirror.defineMode('overlay-mode', function(config) { return CodeMirror.overlayMode(CodeMirror.getMode(config, options.spellChecker !== false ? 'spell-checker' : 'gfm'), options.overlayMode.mode, options.overlayMode.combine); }); - + mode = 'overlay-mode'; backdrop = options.parsingConfig; backdrop.gitHubSpice = false; @@ -2084,11 +2084,11 @@ EasyMDE.prototype.render = function (el) { }); } - function handleImages() { - if (options.previewImagesInEditor === false) { + if (!options.previewImagesInEditor) { return; } + function calcHeight(naturalWidth, naturalHeight) { var height; var viewportWidth = window.getComputedStyle(document.querySelector('.CodeMirror-sizer')).width.replace('px', ''); @@ -2126,8 +2126,6 @@ EasyMDE.prototype.render = function (el) { handleImages(); }); - - this.onWindowResize = function() { handleImages(); };