diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e521a..d02298d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ All notable changes to this project 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] +### Fixed +- Keyboard shortcuts for custom actions not working (Thanks to [@ysykzheng], [#75]). + ## [2.6.0] - 2019-04-15 ### Added - Contributing guide (Thanks to [@roipoussiere], [#54]). @@ -107,12 +110,14 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown [#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9 +[#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75 [#54]: https://github.com/Ionaru/easy-markdown-editor/pull/54 [#31]: https://github.com/Ionaru/easy-markdown-editor/pull/31 [#27]: https://github.com/Ionaru/easy-markdown-editor/pull/27 [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19 +[@ysykzheng]: https://github.com/ysykzheng [@roipoussiere]: https://github.com/roipoussiere [@FranklinWhale]: https://github.com/FranklinWhale [@Furgas]: https://github.com/Furgas diff --git a/src/js/easymde.js b/src/js/easymde.js index 9f7b074..fcfa951 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -1561,7 +1561,12 @@ EasyMDE.prototype.render = function (el) { if (options.shortcuts[key] !== null && bindings[key] !== null) { (function (key) { keyMaps[fixShortcut(options.shortcuts[key])] = function () { - bindings[key](self); + var action = bindings[key]; + if (typeof action === 'function') { + action(self); + } else if (typeof action === 'string') { + window.open(action, '_blank'); + } }; })(key); } @@ -2130,6 +2135,7 @@ EasyMDE.prototype.isPreviewActive = function () { return /editor-preview-active/.test(preview.className); }; + EasyMDE.prototype.isSideBySideActive = function () { var cm = this.codemirror; var wrapper = cm.getWrapperElement();