mirror of
https://github.com/codex-team/editor.js
synced 2024-06-26 09:20:07 +02:00
parent
a9c4649a4a
commit
d086b6daf9
4
dist/editor.js
vendored
4
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -435,11 +435,14 @@ export default class BlockEvents extends Module {
|
|||
* Handle right and down keyboard keys
|
||||
*/
|
||||
private arrowRightAndDown(event: KeyboardEvent): void {
|
||||
const isFlipperCombination = Flipper.usedKeys.includes(event.keyCode) &&
|
||||
(!event.shiftKey || event.keyCode === _.keyCodes.TAB);
|
||||
|
||||
/**
|
||||
* Arrows might be handled on toolbars by flipper
|
||||
* Check for Flipper.usedKeys to allow navigate by DOWN and disallow by RIGHT
|
||||
*/
|
||||
if (this.Editor.UI.someToolbarOpened && Flipper.usedKeys.includes(event.keyCode)) {
|
||||
if (this.Editor.UI.someToolbarOpened && isFlipperCombination) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -487,8 +490,12 @@ export default class BlockEvents extends Module {
|
|||
* Arrows might be handled on toolbars by flipper
|
||||
* Check for Flipper.usedKeys to allow navigate by UP and disallow by LEFT
|
||||
*/
|
||||
if (this.Editor.UI.someToolbarOpened && Flipper.usedKeys.includes(event.keyCode)) {
|
||||
return;
|
||||
if (this.Editor.UI.someToolbarOpened) {
|
||||
if (Flipper.usedKeys.includes(event.keyCode) && (!event.shiftKey || event.keyCode === _.keyCodes.TAB)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.Editor.UI.closeAllToolbars();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -211,6 +211,18 @@ export default class UI extends Module {
|
|||
this.nodes.holder.innerHTML = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Close all Editor's toolbars
|
||||
*/
|
||||
public closeAllToolbars(): void {
|
||||
const { Toolbox, BlockSettings, InlineToolbar, ConversionToolbar } = this.Editor;
|
||||
|
||||
BlockSettings.close();
|
||||
InlineToolbar.close();
|
||||
ConversionToolbar.close();
|
||||
Toolbox.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for mobile mode and cache a result
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue