Add escape key to markdown toolbar #1831

This commit is contained in:
DianaXWiki 2025-04-14 13:19:26 +03:00 committed by yflory
parent 20f3ff43fe
commit b0d543b5fb

View File

@ -1171,6 +1171,14 @@ define([
var href = Messages.mdToolbar_tutorial;
common.openUnsafeURL(href);
}).appendTo($toolbar);
$toolbar.on('keydown', function (e) {
if (e.key === 'Escape' || e.keyCode === 27) {
editor.focus();
e.preventDefault();
}
});
return $toolbar;
};
UIElements.createMarkdownToolbar = function (common, editor, opts) {