diff --git a/public/static/common/js/app.js b/public/static/common/js/app.js new file mode 100644 index 0000000..00bd757 --- /dev/null +++ b/public/static/common/js/app.js @@ -0,0 +1,30 @@ + +const loading = {}; +loading.index = 0; +loading.showCount = 0; +loading.show = function (count) { + + if (typeof count == 'undefined') { + count = 1; + } + + if (loading.showCount == 0) { + loading.index = layer.load() + } + + loading.showCount += count; +} + +loading.hide = function () { + + loading.showCount--; + + if (loading.showCount < 0) { + loading.showCount = 0; + } + + if (loading.showCount == 0) { + layer.close(loading.index); + } + +} \ No newline at end of file