mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Fix focus issues #1831
This commit is contained in:
parent
d183557828
commit
ac02106bea
@ -1304,7 +1304,7 @@ define([
|
||||
}
|
||||
}
|
||||
|
||||
if (appType !== 'code') {
|
||||
if (appType !== 'code' && appType !== 'slide') {
|
||||
$(window).on('resize', updateToolbarVisibility);
|
||||
updateToolbarVisibility();
|
||||
}
|
||||
|
||||
@ -1098,6 +1098,7 @@ define([
|
||||
editor.setOption("extraKeys", {
|
||||
"Esc": function () {
|
||||
editor.display.input.blur();
|
||||
$(cancelBlock).focus();
|
||||
},
|
||||
});
|
||||
editor.setOption('lineNumbers', true);
|
||||
@ -1115,7 +1116,12 @@ define([
|
||||
}
|
||||
editor.refresh();
|
||||
editor.save();
|
||||
editor.focus();
|
||||
var firstBtn = $(markdownTb.toolbar).find('button').get(0);
|
||||
if (firstBtn) {
|
||||
firstBtn.focus();
|
||||
} else {
|
||||
editor.focus(); // fallback
|
||||
}
|
||||
});
|
||||
var toggleRow = h('div.cp-markdown-toggle-row');
|
||||
|
||||
@ -5580,6 +5586,7 @@ define([
|
||||
var editor = APP.responseEditor = cm.editor;
|
||||
editor.setOption("extraKeys", {
|
||||
"Esc": function() {
|
||||
editor.display.input.blur();
|
||||
$(preview).focus();
|
||||
}
|
||||
});
|
||||
@ -5613,6 +5620,14 @@ define([
|
||||
$preview.hide();
|
||||
editor.refresh();
|
||||
$tb.show();
|
||||
setTimeout(function () {
|
||||
var firstBtn = $(markdownTb.toolbar).find('button').get(0);
|
||||
if (firstBtn) {
|
||||
firstBtn.focus();
|
||||
} else {
|
||||
editor.focus(); // fallback
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
APP.$e = $e;
|
||||
APP.$p = $p;
|
||||
|
||||
@ -551,6 +551,10 @@ define([
|
||||
$(code).show();
|
||||
APP.editor.refresh();
|
||||
$(button).hide();
|
||||
var firstBtn = $(markdownTb.toolbar).find('button').get(0);
|
||||
if (firstBtn) {
|
||||
firstBtn.focus();
|
||||
}
|
||||
});
|
||||
$(save).click(function () {
|
||||
$(save).hide();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user