style(js): break long lines

This commit is contained in:
Philipp Matthias Schaefer 2021-02-27 14:53:12 +01:00
parent f54337f43e
commit 0916b3fa7c

View File

@ -27,7 +27,9 @@ MODAL_STATES = {
}, },
"FetchError" : { "FetchError" : {
button_disabled : false, button_disabled : false,
message : function(parameters) { `An error occurred while contacting the server ({parameters.statusCode})` }, message : function(parameters) {
`An error occurred while contacting the server (${parameters.statusCode})`
},
}, },
"ServerError" : { "ServerError" : {
button_disabled : false, button_disabled : false,
@ -50,7 +52,9 @@ function showModal(state_name, parameters) {
img.src = state.icon_url; img.src = state.icon_url;
let text = message.childNodes[1]; let text = message.childNodes[1];
text.textContent = " " + (state.message instanceof Function ? state.message(parameters) : state.message); text.textContent = " " + (state.message instanceof Function
? state.message(parameters)
: state.message);
let button = document.getElementById("close_button"); let button = document.getElementById("close_button");
button.disabled = state.button_disabled; button.disabled = state.button_disabled;
@ -70,7 +74,8 @@ function changePasswords() {
let query = {}; let query = {};
for (field in FIELDS) { for (field in FIELDS) {
query[FIELDS[field]] = document.querySelectorAll('input[name=' + FIELDS[field] + ']')[0].value; let selector = `input[name=${FIELDS[field]}]`;
query[FIELDS[field]] = document.querySelectorAll(selector)[0].value;
} }
showModal("Wait"); showModal("Wait");