From 9e799ec3aeb46b7f2089f5613a611f286102e33a Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 25 Feb 2020 12:05:31 -0600 Subject: [PATCH 1/2] Add loading status to submit buttons Signed-off-by: jolheiser --- web_src/js/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web_src/js/index.js b/web_src/js/index.js index d4f8bb40e4592..2af7a175617df 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2610,6 +2610,14 @@ $(document).ready(async () => { } }); + $('form.ui.form button').click(function () { + const $this = $(this); + $this.addClass('loading disabled'); + setTimeout(() => { + $this.removeClass('loading disabled'); + }, 1000 * 5); // 5 seconds + }); + // parallel init of lazy-loaded features [hljs] = await Promise.all([ initHighlight(), From 6eb27a289309be55a07578e4be9ae2f63268810a Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 25 Feb 2020 12:50:29 -0600 Subject: [PATCH 2/2] !important Signed-off-by: jolheiser --- web_src/js/index.js | 4 ++-- web_src/less/_base.less | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index 2af7a175617df..87c2ae2902dc5 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2612,9 +2612,9 @@ $(document).ready(async () => { $('form.ui.form button').click(function () { const $this = $(this); - $this.addClass('loading disabled'); + $this.addClass('loading'); setTimeout(() => { - $this.removeClass('loading disabled'); + $this.removeClass('loading'); }, 1000 * 5); // 5 seconds }); diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 3b40abe208b52..e14a17e6e8523 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -1205,3 +1205,7 @@ i.icon.centerlock { .ui.attached.segment + .ui.attached.header { margin-top: 1rem; } + +button.loading { + pointer-events: none !important; +}