From 59129d2372f891e5fc9151afa4a33e8350ab60f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Thu, 10 Jan 2019 18:46:33 +0100 Subject: [PATCH] Add toolbars destroy in WidgetToolbarRepository plugin. --- src/widgettoolbarrepository.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/widgettoolbarrepository.js b/src/widgettoolbarrepository.js index 7d6757b9..49f6d761 100644 --- a/src/widgettoolbarrepository.js +++ b/src/widgettoolbarrepository.js @@ -93,6 +93,14 @@ export default class WidgetToolbarRepository extends Plugin { }, { priority: 'low' } ); } + destroy() { + super.destroy(); + + for ( const toolbarConfig of this._toolbarDefinitions.values() ) { + toolbarConfig.view.destroy(); + } + } + /** * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked * `getRelatedElement` function. Toolbar items are gathered from `items` array.