Skip to content

Commit

Permalink
Fix #952
Browse files Browse the repository at this point in the history
  • Loading branch information
neSpecc committed Nov 30, 2019
1 parent 1e20882 commit 84f1a61
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions dist/editor.js

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions src/components/modules/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ export default class UI extends Module {
* Fired before click
*
* Used to change current block — we need to do it before 'selectionChange' event.
* Also:
* - Move and show the Toolbar
* - Set a Caret
*/
private documentTouched(event: MouseEvent | TouchEvent): void {
let clickedNode = event.target as HTMLElement;
Expand Down Expand Up @@ -550,6 +553,16 @@ export default class UI extends Module {
this.Editor.Caret.setToTheLastBlock();
}
}

/**
* Move and open toolbar
*/
this.Editor.Toolbar.open();

/**
* Hide the Plus Button
*/
this.Editor.Toolbar.plusButton.hide();
}

/**
Expand All @@ -558,12 +571,9 @@ export default class UI extends Module {
* @param {MouseEvent} event
*
* @description
* - Move and show the Toolbar
* - Set a Caret
* - By clicks on the Editor's bottom zone:
* - if last Block is empty, set a Caret to this
* - otherwise, add a new empty Block and set a Caret to that
* - Hide the Inline Toolbar
*/
private redactorClicked(event: MouseEvent): void {
if (!Selection.isCollapsed) {
Expand All @@ -573,16 +583,6 @@ export default class UI extends Module {
event.stopImmediatePropagation();
event.stopPropagation();

/**
* Move and open toolbar
*/
this.Editor.Toolbar.open();

/**
* Hide the Plus Button
*/
this.Editor.Toolbar.plusButton.hide();

if (!this.Editor.BlockManager.currentBlock) {
this.Editor.BlockManager.insert();
}
Expand Down

0 comments on commit 84f1a61

Please sign in to comment.