From 9e9470919257d19714de281e75343b985e697904 Mon Sep 17 00:00:00 2001 From: ysykzheng Date: Tue, 26 Mar 2019 23:36:17 +0800 Subject: [PATCH] fix custom action shortcut not working --- src/js/easymde.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/easymde.js b/src/js/easymde.js index 1c44517..9f7b074 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -122,6 +122,11 @@ function createToolbarButton(options, enableTooltips, shortcuts) { el.setAttribute('type', 'button'); enableTooltips = (enableTooltips == undefined) ? true : enableTooltips; + // Properly hande custom shortcuts + if( options.name && options.name in shortcuts ){ + bindings[options.name] = options.action; + } + if (options.title && enableTooltips) { el.title = createTooltip(options.title, options.action, shortcuts);