Fix ESLint

This commit is contained in:
Cohee 2024-04-13 15:24:49 +03:00
parent f79f335491
commit de8339f77b
1 changed files with 7 additions and 7 deletions

View File

@ -71,7 +71,7 @@ export class Popup {
this.ok.textContent = okButton ?? 'OK';
this.cancel.textContent = cancelButton ?? 'Cancel';
switch(type) {
switch (type) {
case POPUP_TYPE.TEXT: {
this.input.style.display = 'none';
this.cancel.style.display = 'none';
@ -107,16 +107,16 @@ export class Popup {
// illegal argument
}
this.input.addEventListener('keydown', (evt)=>{
this.input.addEventListener('keydown', (evt) => {
if (evt.key != 'Enter' || evt.altKey || evt.ctrlKey || evt.shiftKey) return;
evt.preventDefault();
evt.stopPropagation();
this.completeAffirmative();
});
this.ok.addEventListener('click', ()=>this.completeAffirmative());
this.cancel.addEventListener('click', ()=>this.completeNegative());
const keyListener = (evt)=>{
this.ok.addEventListener('click', () => this.completeAffirmative());
this.cancel.addEventListener('click', () => this.completeNegative());
const keyListener = (evt) => {
switch (evt.key) {
case 'Escape': {
evt.preventDefault();
@ -134,7 +134,7 @@ export class Popup {
async show() {
document.body.append(this.dom);
this.dom.style.display = 'block';
switch(this.type) {
switch (this.type) {
case POPUP_TYPE.INPUT: {
this.input.focus();
break;
@ -203,7 +203,7 @@ export class Popup {
duration: animation_duration,
easing: animation_easing,
});
delay(animation_duration).then(()=>{
delay(animation_duration).then(() => {
this.dom.remove();
});