chore: eslint
This commit is contained in:
parent
07ef6107b7
commit
cc5ba8ff79
@ -43,7 +43,7 @@ export class EventManager {
|
||||
}
|
||||
|
||||
removeAllEventListenersFromUtil() {
|
||||
this._debugLog('removeAllEventListenersFromUtil',);
|
||||
this._debugLog('removeAllEventListenersFromUtil');
|
||||
for (let eventWrapper of this._registeredListeners) {
|
||||
let element = eventWrapper.element;
|
||||
element.removeEventListener(eventWrapper.eventType, eventWrapper.eventHandler);
|
||||
@ -73,7 +73,7 @@ export class EventWrapper {
|
||||
_eventType;
|
||||
_eventHandler;
|
||||
_element;
|
||||
_options
|
||||
_options;
|
||||
|
||||
constructor(_eventType, _eventHandler, _element, _options) {
|
||||
if(!_eventType || !_eventHandler || !_element) {
|
||||
|
||||
@ -469,7 +469,7 @@ export class StorageManager {
|
||||
},
|
||||
body: JSON.stringify(requestBody),
|
||||
}).then(
|
||||
(response) => response.json()
|
||||
(response) => response.json(),
|
||||
).then((response) => {
|
||||
console.log('storage-manager got key from response:', response, 'with options:', options);
|
||||
if (response.salt !== requestBody.salt || response.timestamp !== requestBody.timestamp) {
|
||||
|
||||
@ -165,7 +165,7 @@ export class Alerts {
|
||||
|
||||
this._elevateAlerts();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_createAlertElement(type, content, icon = 'info-circle') {
|
||||
const alertElement = document.createElement('div');
|
||||
|
||||
@ -95,13 +95,13 @@ export class AsyncForm {
|
||||
headers: headers,
|
||||
body: body,
|
||||
}).then(
|
||||
(response) => response.json()
|
||||
(response) => response.json(),
|
||||
).then(
|
||||
(response) => this._processResponse(response[0])
|
||||
(response) => this._processResponse(response[0]),
|
||||
).catch(() => {
|
||||
const failureMessage = this._app.i18n.get('asyncFormFailure');
|
||||
this._processResponse({ content: failureMessage });
|
||||
this._element.classList.remove(ASYNC_FORM_LOADING_CLASS);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -383,7 +383,7 @@ export class AsyncTable {
|
||||
url = window.location.origin + window.location.pathname + url;
|
||||
}
|
||||
this._updateTableFrom(url);
|
||||
}
|
||||
};
|
||||
|
||||
_getClickDestination(el) {
|
||||
if (!el.matches('a') && !el.querySelector('a')) {
|
||||
@ -407,7 +407,7 @@ export class AsyncTable {
|
||||
}
|
||||
|
||||
this._updateTableFrom(url.href);
|
||||
}
|
||||
};
|
||||
|
||||
// fetches new sorted element from url with params and replaces contents of current element
|
||||
_updateTableFrom(url, callback, isPopState) {
|
||||
@ -458,7 +458,7 @@ export class AsyncTable {
|
||||
callback(this._element);
|
||||
this._windowStorage.remove('cssIdPrefix');
|
||||
}
|
||||
}).catch((err) => console.error(err)
|
||||
}).catch((err) => console.error(err),
|
||||
).finally(() => this._element.classList.remove(ASYNC_TABLE_LOADING_CLASS));
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ class CheckAllColumn {
|
||||
_table;
|
||||
_column;
|
||||
|
||||
_eventManager
|
||||
_eventManager;
|
||||
|
||||
_checkAllCheckbox;
|
||||
_checkboxId = 'check-all-checkbox-' + Math.floor(Math.random() * 100000);
|
||||
@ -146,7 +146,7 @@ class CheckAllColumn {
|
||||
|
||||
_updateCheckAllCheckboxState() {
|
||||
const allChecked = this._column.every(cell =>
|
||||
cell.tagName == 'TH' || cell.querySelector(CHECKBOX_SELECTOR).checked
|
||||
cell.tagName == 'TH' || cell.querySelector(CHECKBOX_SELECTOR).checked,
|
||||
);
|
||||
this._checkAllCheckbox.checked = allChecked;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ const COURSE_TEASER_CHEVRON_CLASS = 'course-teaser__chevron';
|
||||
export class CourseTeaser {
|
||||
|
||||
_element;
|
||||
_eventManager
|
||||
_eventManager;
|
||||
|
||||
constructor(element) {
|
||||
if (!element) {
|
||||
|
||||
@ -133,7 +133,7 @@ export class ExamCorrect {
|
||||
|
||||
this._cIndices = new Map(
|
||||
[...this._element.querySelectorAll('[uw-exam-correct-header]')]
|
||||
.map((header) => [header.getAttribute('uw-exam-correct-header'), header.cellIndex])
|
||||
.map((header) => [header.getAttribute('uw-exam-correct-header'), header.cellIndex]),
|
||||
);
|
||||
|
||||
if (this._resultSelect && this._resultGradeSelect) {
|
||||
@ -220,9 +220,9 @@ export class ExamCorrect {
|
||||
headers: EXAM_CORRECT_HEADERS,
|
||||
body: JSON.stringify(body),
|
||||
}).then(
|
||||
(response) => response.json()
|
||||
(response) => response.json(),
|
||||
).then(
|
||||
(response) => this._processResponse(body, response, body.user)
|
||||
(response) => this._processResponse(body, response, body.user),
|
||||
).catch((error) => {
|
||||
console.error('Error while validating user input', error);
|
||||
});
|
||||
@ -312,9 +312,9 @@ export class ExamCorrect {
|
||||
headers: EXAM_CORRECT_HEADERS,
|
||||
body: JSON.stringify(body),
|
||||
}).then(
|
||||
(response) => response.json()
|
||||
(response) => response.json(),
|
||||
).then(
|
||||
(response) => this._processResponse(body, response, user, undefined, { results: results, result: result })
|
||||
(response) => this._processResponse(body, response, user, undefined, { results: results, result: result }),
|
||||
).catch((error) => {
|
||||
console.error('Error while processing response', error);
|
||||
});
|
||||
@ -553,8 +553,8 @@ export class ExamCorrect {
|
||||
headers: EXAM_CORRECT_HEADERS,
|
||||
body: JSON.stringify(body),
|
||||
}).then(
|
||||
(response) => response.json()
|
||||
).then((response) => this._processResponse(body, response, userElem.getAttribute(EXAM_CORRECT_USER_ATTR), row, { results: results.partResults, result: results.result })
|
||||
(response) => response.json(),
|
||||
).then((response) => this._processResponse(body, response, userElem.getAttribute(EXAM_CORRECT_USER_ATTR), row, { results: results.partResults, result: results.result }),
|
||||
).catch(console.error);
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ export class AutoSubmitInput {
|
||||
this._element.classList.remove(AUTO_SUBMIT_INPUT_INITIALIZED_CLASS);
|
||||
}
|
||||
|
||||
autoSubmit = () => {
|
||||
autoSubmit() {
|
||||
this._form.submit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ const CHECKBOX_SELECTOR = '[type="checkbox"]';
|
||||
export class CheckRange {
|
||||
_lastCheckedCell = null;
|
||||
_element;
|
||||
_tableIndices
|
||||
_tableIndices;
|
||||
_columns = new Array();
|
||||
|
||||
constructor(element) {
|
||||
|
||||
@ -206,7 +206,7 @@ export class MassInput {
|
||||
if (this._massInputFormSubmitHandler) {
|
||||
return this._massInputFormSubmitHandler(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_getMassInputSubmitButtons() {
|
||||
return Array.from(this._element.querySelectorAll('button[type="submit"][name][value], .' + MASS_INPUT_SUBMIT_BUTTON_CLASS));
|
||||
|
||||
@ -29,7 +29,7 @@ const MODALS_WRAPPER_OPEN_CLASS = 'modals-wrapper--open';
|
||||
})
|
||||
export class Modal {
|
||||
|
||||
_eventManager
|
||||
_eventManager;
|
||||
|
||||
_element;
|
||||
_app;
|
||||
@ -123,18 +123,18 @@ export class Modal {
|
||||
_onTriggerClicked = (event) => {
|
||||
event.preventDefault();
|
||||
this._open();
|
||||
}
|
||||
};
|
||||
|
||||
_onCloseClicked = (event) => {
|
||||
event.preventDefault();
|
||||
this._close();
|
||||
}
|
||||
};
|
||||
|
||||
_onKeyUp = (event) => {
|
||||
if (event.key === 'Escape') {
|
||||
this._close();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_open() {
|
||||
this._element.classList.add(MODAL_OPEN_CLASS);
|
||||
@ -162,9 +162,9 @@ export class Modal {
|
||||
url: url,
|
||||
headers: MODAL_HEADERS,
|
||||
}).then(
|
||||
(response) => this._app.htmlHelpers.parseResponse(response)
|
||||
(response) => this._app.htmlHelpers.parseResponse(response),
|
||||
).then(
|
||||
(response) => this._processResponse(response.element)
|
||||
(response) => this._processResponse(response.element),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user