2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-02 15:44:28 -06:00

Fixed shortcut code so links are opened as well.

This commit is contained in:
Jeroen Akkerman 2019-04-15 15:20:48 +02:00
parent 2a0def5fb5
commit cc0c211759

View File

@ -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();