mirror of
https://github.com/codex-team/editor.js
synced 2024-06-26 09:20:07 +02:00
Fix flipper activate/deactivate when conversionToolbarOpened (#1001)
* Fix flipper activate/deactivate when conversionToolbarOpened * fix bug with flipping inline toolbar * update changelog * added comment for new condition * upd bundle Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com> Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
This commit is contained in:
parent
bc3e2904f0
commit
3a83a1d12e
2
dist/editor.js
vendored
2
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,8 @@
|
|||
|
||||
- `Improvements` - Editor's [onchange callback](https://editorjs.io/configuration#editor-modifications-callback) now accepts an API as a parameter
|
||||
- `Fix` - Some mistakes are fixed in [installation.md](installation.md)
|
||||
- `Fix` - Fixed multiple paste callback triggering in a case when several editors are instantiated [#1011](https://github.com/codex-team/editor.js/issues/1011)
|
||||
- `Fix` - Fixed multiple paste callback triggering in a case when several editors are instantiated [#1011](https://github.com/codex-team/editor.js/issues/1011)
|
||||
- `Fix` - Fixed inline toolbar flipper activation on closing conversion toolbar [#995](https://github.com/codex-team/editor.js/issues/995)
|
||||
|
||||
### 2.16.1
|
||||
|
||||
|
|
|
@ -98,8 +98,6 @@ export default class ConversionToolbar extends Module {
|
|||
|
||||
if (typeof togglingCallback === 'function') {
|
||||
this.togglingCallback = togglingCallback;
|
||||
|
||||
this.togglingCallback(this.opened);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -431,10 +431,19 @@ export default class InlineToolbar extends Module {
|
|||
|
||||
this.Editor.Listeners.on(this.nodes.conversionToggler, 'click', () => {
|
||||
this.Editor.ConversionToolbar.toggle((conversionToolbarOpened) => {
|
||||
if (conversionToolbarOpened) {
|
||||
this.flipper.deactivate();
|
||||
} else {
|
||||
/**
|
||||
* When ConversionToolbar is opening on activated InlineToolbar flipper
|
||||
* Then we need to temporarily deactivate InlineToolbar flipper so that we could flip ConversionToolbar items
|
||||
*
|
||||
* Other case when ConversionToolbar is closing (for example, by escape) but we need to continue flipping
|
||||
* InlineToolbar items, we activate InlineToolbar flipper
|
||||
*/
|
||||
const canActivateInlineToolbarFlipper = !conversionToolbarOpened && this.opened;
|
||||
|
||||
if (canActivateInlineToolbarFlipper) {
|
||||
this.flipper.activate();
|
||||
} else if (this.opened) {
|
||||
this.flipper.deactivate();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue