From e1ad67b25f03fc39b4da67d400465ea451e2a234 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Tue, 4 Jun 2024 02:40:51 +0530 Subject: [PATCH] disable macros button --- src/js/macros.js | 7 +++++-- src/pug/templates/macros.pug | 2 +- src/stylus/style.styl | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index bd2ed41..cf8994d 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -56,8 +56,11 @@ module.exports = { initial_tab: function () { return this.tab == 0; }, - downloadMacrosUrl() { - return '/api/macros/download/' + this.state.macros_list.map(item => item.file_name).join(','); + download_macros_url: function () { + return "/api/macros/download/" + this.state.macros_list.map(item => item.file_name).join(","); + }, + can_download_macros: function () { + return this.state.macros_list.length; }, }, methods: { diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index 33e1f78..3be20b9 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -73,7 +73,7 @@ script#macros-template(type="text/x-template") .fa.fa-trash |  Yes - a(download, title="Download Macros", :href="downloadMacrosUrl", style="text-decoration: none;") + a(download, title="Download Macros", :href="download_macros_url", style="text-decoration: none;", :disabled="!can_download_macros") button.config-button.button-blue(style="width:160px;") Download Macros .warning-box diff --git a/src/stylus/style.styl b/src/stylus/style.styl index e302d8b..b7f2234 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -708,7 +708,7 @@ span.unit .flex-row-container display flex flex-direction row - width 700px + width 710px margin-bottom 1rem .tabs