Skip to content

Commit bee449b

Browse files
authored
Fix #952 (#969)
1 parent 1e20882 commit bee449b

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

dist/editor.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/modules/ui.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ export default class UI extends Module {
515515
* Fired before click
516516
*
517517
* Used to change current block — we need to do it before 'selectionChange' event.
518+
* Also:
519+
* - Move and show the Toolbar
520+
* - Set a Caret
518521
*/
519522
private documentTouched(event: MouseEvent | TouchEvent): void {
520523
let clickedNode = event.target as HTMLElement;
@@ -550,6 +553,16 @@ export default class UI extends Module {
550553
this.Editor.Caret.setToTheLastBlock();
551554
}
552555
}
556+
557+
/**
558+
* Move and open toolbar
559+
*/
560+
this.Editor.Toolbar.open();
561+
562+
/**
563+
* Hide the Plus Button
564+
*/
565+
this.Editor.Toolbar.plusButton.hide();
553566
}
554567

555568
/**
@@ -558,12 +571,9 @@ export default class UI extends Module {
558571
* @param {MouseEvent} event
559572
*
560573
* @description
561-
* - Move and show the Toolbar
562-
* - Set a Caret
563574
* - By clicks on the Editor's bottom zone:
564575
* - if last Block is empty, set a Caret to this
565576
* - otherwise, add a new empty Block and set a Caret to that
566-
* - Hide the Inline Toolbar
567577
*/
568578
private redactorClicked(event: MouseEvent): void {
569579
if (!Selection.isCollapsed) {
@@ -573,16 +583,6 @@ export default class UI extends Module {
573583
event.stopImmediatePropagation();
574584
event.stopPropagation();
575585

576-
/**
577-
* Move and open toolbar
578-
*/
579-
this.Editor.Toolbar.open();
580-
581-
/**
582-
* Hide the Plus Button
583-
*/
584-
this.Editor.Toolbar.plusButton.hide();
585-
586586
if (!this.Editor.BlockManager.currentBlock) {
587587
this.Editor.BlockManager.insert();
588588
}

0 commit comments

Comments
 (0)