mirror of
https://github.com/codex-team/editor.js
synced 2026-03-18 08:29:52 +01:00
Support toggling
This commit is contained in:
parent
3cf83089be
commit
b566332673
1 changed files with 4 additions and 0 deletions
|
|
@ -446,6 +446,10 @@ export default class Popover extends EventsDispatcher<PopoverEvent> {
|
|||
|
||||
if (clickedItem.closeOnActivate) {
|
||||
this.hide();
|
||||
} else {
|
||||
/** If popover is not intended to close once item is activated, we need to update active state of activated item */
|
||||
clickedItem.isActive = !clickedItem.isActive;
|
||||
itemEl.classList.toggle(Popover.CSS.itemActive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue