From 898ba05bfc48d56f682e3e4c995e065f58bf75d3 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Fri, 7 Aug 2020 16:22:20 +0800 Subject: [PATCH] Hide tab in iso modal when there are no items --- _layouts/index.html | 6 +++--- static/js/index.es6 | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/_layouts/index.html b/_layouts/index.html index 1b7bb4f..e5eee96 100644 --- a/_layouts/index.html +++ b/_layouts/index.html @@ -150,9 +150,9 @@
diff --git a/static/js/index.es6 b/static/js/index.es6 index 922f569..0196249 100644 --- a/static/js/index.es6 +++ b/static/js/index.es6 @@ -186,15 +186,19 @@ var vmIso = new Vue({ }); }, computed: { - curDistroList () { + curDistroList() { return this.distroList - .filter((x)=> x.category === this.curCategory) + .filter((x) => x.category === this.curCategory) .sort(function (a, b) { return a.distro.localeCompare(b.distro); }); - } + }, }, methods: { + showCategory(category) { + return this.distroList + .findIndex((x) => x.category === category) > -1; + }, switchDistro (distro) { this.selected = distro; },