From 549b2d52a48483610f9a46fe7be63cc82cd4a518 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 20 May 2024 21:58:45 +0300 Subject: [PATCH] Remove unnecessary DOM query --- public/scripts/popup.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/public/scripts/popup.js b/public/scripts/popup.js index f7dfe9f81..17d380367 100644 --- a/public/scripts/popup.js +++ b/public/scripts/popup.js @@ -68,10 +68,9 @@ export class Popup { if (allowHorizontalScrolling) dlg.classList.add('horizontal_scrolling_dialogue_popup'); if (allowVerticalScrolling) dlg.classList.add('vertical_scrolling_dialogue_popup'); - const localeDataHolder = $('#shadow_popup_template'); this.ok.textContent = okButton ?? 'OK'; - this.cancel.textContent = cancelButton ?? localeDataHolder.attr('popup_text_cancel'); - + this.cancel.textContent = cancelButton ?? template.getAttribute('popup_text_cancel'); + switch (type) { case POPUP_TYPE.TEXT: { this.input.style.display = 'none'; @@ -80,13 +79,13 @@ export class Popup { } case POPUP_TYPE.CONFIRM: { this.input.style.display = 'none'; - this.ok.textContent = okButton ?? localeDataHolder.attr('popup_text_yes'); - this.cancel.textContent = cancelButton ?? localeDataHolder.attr('popup_text_no'); + this.ok.textContent = okButton ?? template.getAttribute('popup_text_yes'); + this.cancel.textContent = cancelButton ?? template.getAttribute('popup_text_no'); break; } case POPUP_TYPE.INPUT: { this.input.style.display = 'block'; - this.ok.textContent = okButton ?? localeDataHolder.attr('popup_text_save'); + this.ok.textContent = okButton ?? template.getAttribute('popup_text_save'); break; } default: {