Merge branch 'release/2.16' of https://github.com/codex-team/editor.js into release/2.16

This commit is contained in:
Peter Savchenko 2019-11-30 21:41:08 +03:00
commit 053e25ebdb
No known key found for this signature in database
GPG key ID: E68306B1AB0F727C
2 changed files with 27 additions and 27 deletions

10
dist/editor.js vendored

File diff suppressed because one or more lines are too long

View file

@ -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;
@ -550,28 +553,6 @@ export default class UI extends Module {
this.Editor.Caret.setToTheLastBlock();
}
}
}
/**
* All clicks on the redactor zone
*
* @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) {
return;
}
event.stopImmediatePropagation();
event.stopPropagation();
/**
* Move and open toolbar
@ -582,6 +563,25 @@ export default class UI extends Module {
* Hide the Plus Button
*/
this.Editor.Toolbar.plusButton.hide();
}
/**
* All clicks on the redactor zone
*
* @param {MouseEvent} event
*
* @description
* - 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
*/
private redactorClicked(event: MouseEvent): void {
if (!Selection.isCollapsed) {
return;
}
event.stopImmediatePropagation();
event.stopPropagation();
if (!this.Editor.BlockManager.currentBlock) {
this.Editor.BlockManager.insert();