summaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2021-12-07 23:19:58 +0100
committerGravatar GitHub <noreply@github.com> 2021-12-07 23:19:58 +0100
commit1d624d041fb12162eaae3a428e8eca57dc91d50a (patch)
tree12c84de271354dc1fc37a9be82bc743ac7ae54a4 /p
parentc25dace809c9547d78a2840081612641191e025f (diff)
Fix: global view does not show "no articles to show" alert (#4042)
* fix * phpcs fixed * fix JS
Diffstat (limited to 'p')
-rw-r--r--p/scripts/main.js7
-rw-r--r--p/themes/base-theme/template.css4
-rw-r--r--p/themes/base-theme/template.rtl.css4
3 files changed, 15 insertions, 0 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 16ae7d0f0..3093d1da8 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -1481,9 +1481,11 @@ function refreshUnreads() {
}
const isAll = document.querySelector('.category.all.active');
let new_articles = false;
+ let nbUnreadFeeds = 0;
Object.keys(json.feeds).forEach(function (feed_id) {
const nbUnreads = json.feeds[feed_id];
+ nbUnreadFeeds += nbUnreads;
feed_id = 'f_' + feed_id;
const elem = document.getElementById(feed_id);
const feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0;
@@ -1497,6 +1499,11 @@ function refreshUnreads() {
}
});
+ const noArticlesToShow_div = document.getElementById('noArticlesToShow');
+ if (nbUnreadFeeds > 0 && noArticlesToShow_div) {
+ noArticlesToShow_div.classList.add('hide');
+ }
+
let nbUnreadTags = 0;
Object.keys(json.tags).forEach(function (tag_id) {
diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css
index 421660433..3ac7eea28 100644
--- a/p/themes/base-theme/template.css
+++ b/p/themes/base-theme/template.css
@@ -434,6 +434,10 @@ a.btn {
margin: 5px 20px;
}
+.alert.hide {
+ display: none;
+}
+
/*=== Icons */
.icon {
display: inline-block;
diff --git a/p/themes/base-theme/template.rtl.css b/p/themes/base-theme/template.rtl.css
index 19c27ddd7..fd5436ec2 100644
--- a/p/themes/base-theme/template.rtl.css
+++ b/p/themes/base-theme/template.rtl.css
@@ -434,6 +434,10 @@ a.btn {
margin: 5px 20px;
}
+.alert.hide {
+ display: none;
+}
+
/*=== Icons */
.icon {
display: inline-block;