Inline Toolbar: Selection is not reseted (#543)

* Selection is not reseted if click on toolbar borde

* blue back

* 'refactoring'

* fix double link click

* fix double link click

* fix double link click

* listener

* 'reset'

* reset fix

* add missed bundles, increment version

* update submodules
This commit is contained in:
horoyami 2018-12-06 22:33:32 +03:00 committed by Murod Khaydarov
parent af4f62b254
commit 0ad9484c75
7 changed files with 1471 additions and 6 deletions

1459
build/codex-editor.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit 84826bbd4a66fb4626f8813b50c0d2b1b0ecfa0f
Subproject commit d726836684284dc988a35ac8111c5b89283afbdd

View file

@ -1,6 +1,6 @@
{
"name": "codex.editor",
"version": "2.7.6",
"version": "2.7.7",
"description": "Codex Editor. Native JS, based on API and Open Source",
"main": "dist/codex-editor.js",
"types": "./types/index.d.ts",

View file

@ -118,7 +118,7 @@ export default class LinkInlineTool implements InlineTool {
this.nodes.input.placeholder = 'Add a link';
this.nodes.input.classList.add(this.CSS.input);
this.nodes.input.addEventListener('keydown', (event: KeyboardEvent) => {
if (event.keyCode === this.ENTER_KEY ) {
if (event.keyCode === this.ENTER_KEY) {
this.enterPressed(event);
}
});

View file

@ -109,6 +109,11 @@ export default class InlineToolbar extends Module {
this.nodes.buttons = $.make('div', this.CSS.buttonsWrapper);
this.nodes.actions = $.make('div', this.CSS.actionsWrapper);
// To prevent reset of a selection when click on the wrapper
this.Editor.Listeners.on(this.nodes.wrapper, 'mousedown', (event) => {
event.preventDefault();
});
/**
* Append Inline Toolbar to the Editor
*/