Browse Source

Merge branch 'pull-75'

master
Jeroen Akkerman 1 month ago
parent
commit
aa0304fdaa
2 changed files with 13 additions and 2 deletions
  1. 6
    1
      CHANGELOG.md
  2. 7
    1
      src/js/easymde.js

+ 6
- 1
CHANGELOG.md View File

@@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
4 4
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5 5
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6 6
 
7
-<!--## [Unreleased]-->
7
+## [Unreleased]
8
+### Fixed
9
+- Keyboard shortcuts for custom actions not working (Thanks to [@ysykzheng], [#75]).
10
+
8 11
 ## [2.6.0] - 2019-04-15
9 12
 ### Added
10 13
 - Contributing guide (Thanks to [@roipoussiere], [#54]).
@@ -107,12 +110,14 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
107 110
 [#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9
108 111
 
109 112
 <!-- Linked PRs -->
113
+[#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75
110 114
 [#54]: https://github.com/Ionaru/easy-markdown-editor/pull/54
111 115
 [#31]: https://github.com/Ionaru/easy-markdown-editor/pull/31
112 116
 [#27]: https://github.com/Ionaru/easy-markdown-editor/pull/27
113 117
 [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19
114 118
 
115 119
 <!-- Linked users -->
120
+[@ysykzheng]: https://github.com/ysykzheng
116 121
 [@roipoussiere]: https://github.com/roipoussiere
117 122
 [@FranklinWhale]: https://github.com/FranklinWhale
118 123
 [@Furgas]: https://github.com/Furgas

+ 7
- 1
src/js/easymde.js View File

@@ -1561,7 +1561,12 @@ EasyMDE.prototype.render = function (el) {
1561 1561
         if (options.shortcuts[key] !== null && bindings[key] !== null) {
1562 1562
             (function (key) {
1563 1563
                 keyMaps[fixShortcut(options.shortcuts[key])] = function () {
1564
-                    bindings[key](self);
1564
+                    var action = bindings[key];
1565
+                    if (typeof action === 'function') {
1566
+                        action(self);
1567
+                    } else if (typeof action === 'string') {
1568
+                        window.open(action, '_blank');
1569
+                    }
1565 1570
                 };
1566 1571
             })(key);
1567 1572
         }
@@ -2130,6 +2135,7 @@ EasyMDE.prototype.isPreviewActive = function () {
2130 2135
     return /editor-preview-active/.test(preview.className);
2131 2136
 };
2132 2137
 
2138
+
2133 2139
 EasyMDE.prototype.isSideBySideActive = function () {
2134 2140
     var cm = this.codemirror;
2135 2141
     var wrapper = cm.getWrapperElement();

Loading…
Cancel
Save