Bläddra i källkod

Use HTML5 hidden (#6910)

https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute
Remove remains of `aria-hidden` mostly not used anymore in our logic.
fix https://github.com/FreshRSS/FreshRSS/issues/6909
Alexandre Alapetite 1 år sedan
förälder
incheckning
d9a82e6b9e

+ 2 - 2
app/views/index/normal.phtml

@@ -38,7 +38,7 @@ $today = @strtotime('today');
 
 <main id="stream" class="normal<?= FreshRSS_Context::userConf()->display_posts ? '' : ' hide_posts' ?>">
 	<h1 class="title_hidden"><?= _t('conf.reading.view.normal') ?></h1>
-	<div id="new-article">
+	<div id="new-article" hidden="hidden">
 		<a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a>
 	</div><?php
 	$lastEntry = null;
@@ -198,7 +198,7 @@ $today = @strtotime('today');
 		ob_end_clean();	//Discard the articles headers, as we have no articles
 ?>
 <main id="stream" class="normal">
-	<div id="new-article">
+	<div id="new-article" hidden="hidden">
 		<a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a>
 	</div>
 	<div class="prompt alert alert-warn">

+ 2 - 2
app/views/index/reader.phtml

@@ -12,7 +12,7 @@ $lazyload = FreshRSS_Context::userConf()->lazyload;
 ?>
 <main id="stream" class="reader">
 	<h1 class="title_hidden"><?= _t('conf.reading.view.reader') ?></h1>
-	<div id="new-article">
+	<div id="new-article" hidden="hidden">
 		<a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a>
 	</div><?php
 	$lastEntry = null;
@@ -43,7 +43,7 @@ $lazyload = FreshRSS_Context::userConf()->lazyload;
 		ob_end_clean();	//Discard the articles headers, as we have no articles
 ?>
 <main id="stream" class="reader">
-	<div id="new-article">
+	<div id="new-article" hidden="hidden">
 		<a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a>
 	</div>
 	<div class="prompt alert alert-warn">

+ 1 - 1
p/scripts/main.js

@@ -1779,7 +1779,7 @@ function refreshUnreads() {
 			if ((incUnreadsFeed(null, feed_id, nbUnreads - feed_unreads) || isAll) &&	// Update of current view?
 					(nbUnreads - feed_unreads > 0)) {
 				const newArticle = document.getElementById('new-article');
-				newArticle.setAttribute('aria-hidden', 'false');
+				newArticle.removeAttribute('hidden');
 				newArticle.style.display = 'block';
 				new_articles = true;
 			}

+ 0 - 8
p/themes/base-theme/frss.css

@@ -408,10 +408,6 @@ td.numeric {
 }
 
 /*=== COMPONENTS */
-/*===============*/
-[aria-hidden="true"] {
-	display: none !important;
-}
 
 /* prompt: login + register form + alert message banner */
 .prompt {
@@ -1279,10 +1275,6 @@ input[type="search"] {
 }
 
 /*=== New article notification */
-#new-article {
-	display: none;
-}
-
 #new-article > a {
 	padding: calc(0.25rem + var(--frss-padding-top-bottom)) 1rem;
 	display: block;

+ 0 - 8
p/themes/base-theme/frss.rtl.css

@@ -408,10 +408,6 @@ td.numeric {
 }
 
 /*=== COMPONENTS */
-/*===============*/
-[aria-hidden="true"] {
-	display: none !important;
-}
 
 /* prompt: login + register form + alert message banner */
 .prompt {
@@ -1279,10 +1275,6 @@ input[type="search"] {
 }
 
 /*=== New article notification */
-#new-article {
-	display: none;
-}
-
 #new-article > a {
 	padding: calc(0.25rem + var(--frss-padding-top-bottom)) 1rem;
 	display: block;