From ccdbfd524a6b3e3f074325135b3a38ac5c80a203 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Thu, 17 Aug 2023 15:03:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97?= =?UTF-8?q?=E3=83=88=E3=82=82=E5=85=B1=E9=80=9A=E5=8C=96=E3=80=82=E6=A8=AA?= =?UTF-8?q?=E5=B1=95=E9=96=8B=E3=82=92=E5=AE=B9=E6=98=93=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E3=81=AB=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E5=8C=96=E3=81=97=E3=81=9F=E3=80=82=E7=94=9F=E7=89=A9=E7=94=B1?= =?UTF-8?q?=E6=9D=A5=E7=85=A7=E4=BC=9A=E7=94=BB=E9=9D=A2=E3=81=AB=E5=B1=95?= =?UTF-8?q?=E9=96=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/function/businessLogicScript.js | 46 +++++++++++++++++++ .../src/templates/bioSearchList.html | 15 +++--- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/ecs/jskult-webapp/src/static/function/businessLogicScript.js b/ecs/jskult-webapp/src/static/function/businessLogicScript.js index 56d971e4..6f67cba6 100644 --- a/ecs/jskult-webapp/src/static/function/businessLogicScript.js +++ b/ecs/jskult-webapp/src/static/function/businessLogicScript.js @@ -1,3 +1,49 @@ +// ローディング + +/** + * ローディングクラス + * @param {string} loading_elem_id ローディングのHTML要素 + */ +class Loading { + constructor(loadingElemId = '_loading') { + this.loadingElemId = loadingElemId; + // ロード中かどうか + this.isLoading = false; + } + + /** + * ローディングを開始する。
+ * 開始済みの場合と、ローディングの要素が見つからない場合は何もしない。 + */ + start() { + if (this.isLoading) + return; + + const loadingElem = document.getElementById(this.loadingElemId); + + if (loadingElem) { + this.isLoading = true; + loadingElem.style.display = 'block'; + } + } + + /** + * ローディングを停止する。
+ * 開始されていない場合と、ローディングの要素が見つからない場合は何もしない。 + */ + stop() { + if (!this.isLoading) + return; + + const loadingElem = document.getElementById(this.loadingElemId); + + if (loadingElem) { + this.isLoading = false; + loadingElem.style.display = 'none'; + } + } +} + // 検索フォーム // 戻るボタンの関数 diff --git a/ecs/jskult-webapp/src/templates/bioSearchList.html b/ecs/jskult-webapp/src/templates/bioSearchList.html index 6a33c904..cb72d729 100644 --- a/ecs/jskult-webapp/src/templates/bioSearchList.html +++ b/ecs/jskult-webapp/src/templates/bioSearchList.html @@ -195,10 +195,12 @@ - +