chore(alert): added a start method to alert util

This commit is contained in:
Johannes Eder 2021-08-03 12:14:30 +02:00 committed by Sarah Vaupel
parent e5290f0e57
commit 8c818a46ab

View File

@ -52,25 +52,25 @@ export class Alerts {
this._togglerElement = this._element.querySelector('.' + ALERTS_TOGGLER_CLASS);
this._alertElements = this._gatherAlertElements();
// mark initialized
this._element.classList.add(ALERTS_INITIALIZED_CLASS);
}
start() {
if (this._togglerElement) {
//should there be a start method, to initialize the listeners in initToggler and initAlerts or is this wanted?
this._initToggler();
}
this._initAlerts();
// register http client interceptor to filter out Alerts Header
this._setupHttpInterceptor();
// mark initialized
this._element.classList.add(ALERTS_INITIALIZED_CLASS);
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
if(this._alertElements) {
this._alertElements.forEach(element => element.remove() );
this._alertElements.forEach(element => element.remove());
}
if(this._element.classList.contains(ALERTS_INITIALIZED_CLASS))