diff --git a/src/components/modules/toolbar/blockSettings.ts b/src/components/modules/toolbar/blockSettings.ts index 72d819cc..9ab468b8 100644 --- a/src/components/modules/toolbar/blockSettings.ts +++ b/src/components/modules/toolbar/blockSettings.ts @@ -4,6 +4,8 @@ import * as _ from '../../utils'; import SelectionUtils from '../../selection'; import Block from '../../block'; import Popover from '../../utils/popover'; +import I18n from '../../i18n'; +import { I18nInternalNS } from '../../i18n/namespace-internal'; /** * HTML Elements that used for BlockSettings @@ -16,14 +18,6 @@ interface BlockSettingsNodes { /** * Block Settings * - * ____ Settings Panel ____ - * | ...................... | - * | . Tool Settings . | - * | ...................... | - * | . Default Settings . | - * | ...................... | - * |________________________| - * * @todo Make Block Settings no-module but a standalone class, like Toolbox */ export default class BlockSettings extends Module { @@ -113,10 +107,9 @@ export default class BlockSettings extends Module { this.makeToolTunesButtonsNavigatable(); this.popover = new Popover({ - className: '', searchable: true, - filterLabel: 'Filter', - nothingFoundLabel: 'Nothing found', + filterLabel: I18n.ui(I18nInternalNS.ui.toolbar.toolbox, 'Filter'), + nothingFoundLabel: I18n.ui(I18nInternalNS.ui.toolbar.toolbox, 'Nothing found'), items: targetBlock.getTunesItems(), customContent: this.nodes.toolSettings, }); @@ -168,6 +161,7 @@ export default class BlockSettings extends Module { this.eventsDispatcher.emit(this.events.closed); if (this.popover) { + this.popover.destroy(); this.popover.getElement().remove(); } } diff --git a/src/components/utils/popover.ts b/src/components/utils/popover.ts index 9a673d9b..f85658b8 100644 --- a/src/components/utils/popover.ts +++ b/src/components/utils/popover.ts @@ -417,7 +417,7 @@ export default class Popover extends EventsDispatcher { * Item click handler * * @param itemEl - clicked item - * @param event + * @param event - click event */ private itemClicked(itemEl: HTMLElement, event: MouseEvent): void { const allItems = this.nodes.wrapper.querySelectorAll(`.${Popover.CSS.item}`);