2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-08-10 10:42:44 -06:00

fix custom action shortcut not working

This commit is contained in:
ysykzheng 2019-03-26 23:36:17 +08:00
parent 8f590f4f96
commit 9e94709192

View File

@ -122,6 +122,11 @@ function createToolbarButton(options, enableTooltips, shortcuts) {
el.setAttribute('type', 'button'); el.setAttribute('type', 'button');
enableTooltips = (enableTooltips == undefined) ? true : enableTooltips; 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) { if (options.title && enableTooltips) {
el.title = createTooltip(options.title, options.action, shortcuts); el.title = createTooltip(options.title, options.action, shortcuts);