From 05d9aacecf911fb61465b545009b76ce65e3b580 Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 4 Mar 2022 17:26:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96loading=E5=92=8C=E5=BC=95?= =?UTF-8?q?=E7=94=A8;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/layout/default.html | 1 + public/static/common/js/app.js | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/admin/view/layout/default.html b/app/admin/view/layout/default.html index 3266f10..7ef56ae 100644 --- a/app/admin/view/layout/default.html +++ b/app/admin/view/layout/default.html @@ -23,6 +23,7 @@ CSRF_TOKEN: "{:token()}", }; + diff --git a/public/static/common/js/app.js b/public/static/common/js/app.js index 00bd757..c6f29a8 100644 --- a/public/static/common/js/app.js +++ b/public/static/common/js/app.js @@ -15,9 +15,19 @@ loading.show = function (count) { loading.showCount += count; } -loading.hide = function () { +loading.hide = function (count) { - loading.showCount--; + + if (typeof count == undefined) { + count = 1; + } + + if (count === true) { + count = 1; + loading.showCount = 0; + } + + loading.showCount -= 1; if (loading.showCount < 0) { loading.showCount = 0;