chore: cleanUp instead of removeListeners

This commit is contained in:
Johannes Eder 2021-08-06 15:59:29 +02:00 committed by Sarah Vaupel
parent 7a0715906c
commit 0688eef70c
14 changed files with 17 additions and 18 deletions

View File

@ -63,10 +63,10 @@ export class EventManager {
_debugLog() {}
//_debugLog(fName, ...args) {
// console.log(`[DEBUGLOG] EventManager.${fName}`, { args: args, instance: this });
//}
//_debugLog() {}
_debugLog(fName, ...args) {
console.log(`[DEBUGLOG] EventManager.${fName}`, { args: args, instance: this });
}
}
export class EventWrapper {

View File

@ -69,7 +69,7 @@ export class Alerts {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
this._app.httpClient.removeResponseInterceptor(this._boundResponseInterceptor);
if(this._alertElements) {

View File

@ -40,7 +40,7 @@ export class Asidenav {
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
if(this._element.classList.contains(ASIDENAV_INITIALIZED_CLASS))
this._element.classList.remove(ASIDENAV_INITIALIZED_CLASS);

View File

@ -44,7 +44,7 @@ export class AsyncForm {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
if(this._element.classList.contains(ASYNC_FORM_INITIALIZED_CLASS))
this._element.classList.remove(ASYNC_FORM_INITIALIZED_CLASS);

View File

@ -150,7 +150,7 @@ export class AsyncTable {
destroy() {
this._windowStorage.clear(this._windowStorage._options);
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
this._active = false;
if (this._element.classList.contains(ASYNC_TABLE_INITIALIZED_CLASS))
this._element.classList.remove(ASYNC_TABLE_INITIALIZED_CLASS);

View File

@ -48,7 +48,7 @@ export class CheckAll {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
this._checkAllColumns.forEach((column) => {
if (column._checkAllCheckBox !== undefined)
column._checkAllCheckBox.remove();

View File

@ -30,7 +30,7 @@ export class CourseTeaser {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
if(this._element.classList.contains(COURSE_TEASER_EXPANDED_CLASS)) {
this._element.classList.remove(COURSE_TEASER_EXPANDED_CLASS);
}

View File

@ -172,7 +172,7 @@ export class ExamCorrect {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
}
_updatePartDeleteDisabled(deleteBox) {

View File

@ -45,7 +45,7 @@ export class AutoSubmitInput {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
if(this._element.classList.contains(AUTO_SUBMIT_INPUT_INITIALIZED_CLASS))
this._element.classList.remove(AUTO_SUBMIT_INPUT_INITIALIZED_CLASS);
}

View File

@ -44,8 +44,7 @@ export class CommunicationRecipients {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.removeAllObserversFromUtil();
this._eventManager.cleanUp();
this._removeCheckedCounter();
}

View File

@ -243,7 +243,7 @@ export class Datepicker {
destroy() {
this.datepickerInstance.remove();
this._eventManager.removeAllListenersFromUtil();
this._eventManager.cleanUp();
this._element.classList.remove(DATEPICKER_INITIALIZED_CLASS);
}

View File

@ -56,7 +56,7 @@ export class EnterIsTab {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
if(this._element.classList.contains(ENTER_IS_TAB_INITIALIZED_CLASS))
this._element.classList.remove(ENTER_IS_TAB_INITIALIZED_CLASS);
}

View File

@ -49,7 +49,7 @@ export class FormErrorRemover {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
this._element.classList.remove(FORM_ERROR_REMOVER_INITIALIZED_CLASS);
}

View File

@ -38,7 +38,7 @@ export class FormErrorReporter {
}
destroy() {
this._eventManager.removeAllEventListenersFromUtil();
this._eventManager.cleanUp();
this._removeError();