Skip to content

A free, self-hostable news aggregator…

Global view: use generic CSS class to open panel (#7868)

maTh585875cda7e3
diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml
index 4be568fd0..a5af83412 100644
--- a/app/views/index/global.phtml
+++ b/app/views/index/global.phtml
@@ -58,7 +58,7 @@
$unreadArticles += $cat->nbNotRead();
?>
<div class="box category" data-unread="<?= $cat->nbNotRead() ?>">
- <div class="box-title"><a class="title" data-unread="<?= format_number($cat->nbNotRead()) ?>"
+ <div class="box-title"><a class="title open-panel" data-unread="<?= format_number($cat->nbNotRead()) ?>"
href="<?= Minz_Url::display($url_base) ?>"><h2><?= $cat->name() ?></h2></a></div>
<ul class="box-content scrollbar-thin">
@@ -86,7 +86,7 @@
<li id="f_<?= $feed->id() ?>" class="item feed<?= $error_class, $empty_class, $mute_class ?>" title="<?= $error_title, $empty_title ?>"
data-unread="<?= $feed->nbNotRead() ?>" data-priority="<?= $feed->priority() ?>">
<?php if (FreshRSS_Context::userConf()->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
- <a class="item-title" data-unread="<?= format_number($feed->nbNotRead()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $feed->name() ?></a>
+ <a class="item-title open-panel" data-unread="<?= format_number($feed->nbNotRead()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $feed->name() ?></a>
</li>
<?php } ?>
</ul>
diff --git a/p/scripts/global_view.js b/p/scripts/global_view.js
index 9ee9397cd..ebd65765c 100644
--- a/p/scripts/global_view.js
+++ b/p/scripts/global_view.js
@@ -84,8 +84,7 @@ function init_close_panel() {
}
function init_global_view() {
- // TODO: should be based on generic classes
- document.querySelectorAll('.box a').forEach(function (a) {
+ document.querySelectorAll('.open-panel').forEach(function (a) {
a.onclick = function (ev) {
load_panel(a.href);
return false;