mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Fix #1831
This commit is contained in:
parent
5b748c26ec
commit
3002877418
@ -580,19 +580,8 @@ define([
|
||||
|
||||
editor.setOption("extraKeys", {
|
||||
"Esc": function() {
|
||||
const $toolbar = $('.cp-markdown-toolbar:visible');
|
||||
if ($toolbar.length) {
|
||||
const $btn = $toolbar.find('button:visible').first();
|
||||
if ($btn.length) {
|
||||
setTimeout(() => {
|
||||
$btn[0].focus();
|
||||
$btn[0].scrollIntoView({ block: 'center', behavior: 'smooth' }); // if toolbar is visible then escape key focuses on first button of toolbar
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(body).focus(); //fallback
|
||||
}
|
||||
e.preventDefault();
|
||||
$(body).focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1160,6 +1160,7 @@ define([
|
||||
for (var k in actions) {
|
||||
let $b = $('<button>', {
|
||||
'data-notippy':1,
|
||||
'data-type': k,
|
||||
'class': 'pure-button cp-markdown-' + k,
|
||||
'title': Messages['mdToolbar_' + k] || k,
|
||||
'aria-label': Messages['mdToolbar_' + k] || k
|
||||
|
||||
Loading…
Reference in New Issue
Block a user