Przeglądaj źródła

Change #bigMarkAsRead link in button

See https://github.com/marienfressinaud/FreshRSS/issues/599#issuecomment-55735615
Marien Fressinaud 11 lat temu
rodzic
commit
6f8413403b

+ 6 - 2
app/views/helpers/pagination.phtml

@@ -14,11 +14,15 @@
 			<?php echo _t('load_more'); ?>
 		</a>
 	<?php } elseif ($markReadUrl) { ?>
-		<a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>"<?php if ($this->conf->reading_confirm) { echo ' class="confirm"';} ?>>
+		<button id="bigMarkAsRead"
+		        class="as-link <?php echo $this->conf->reading_confirm ? 'confirm' : ''; ?>"
+		        form="mark-read"
+		        formaction="<?php echo $markReadUrl; ?>"
+		        type="submit">
 			<?php echo _t('nothing_to_load'); ?><br />
 			<span class="bigTick">✓</span><br />
 			<?php echo _t('mark_all_read'); ?>
-		</a>
+		</button>
 	<?php } else { ?>
 		<a id="bigMarkAsRead" href=".">
 			<?php echo _t('nothing_to_load'); ?><br />

+ 6 - 2
p/scripts/main.js

@@ -894,9 +894,13 @@ function load_more_posts() {
 		box_load_more.children('.flux:last').after($('#stream', data).children('.flux, .day'));
 		$('.pagination').replaceWith($('.pagination', data));
 		if (display_order === 'ASC') {
-			$('#nav_menu_read_all>a').attr('href', $('#bigMarkAsRead').attr('href'));
+			$('#nav_menu_read_all > .read_all').attr(
+				'formaction', $('#bigMarkAsRead').attr('formaction')
+			);
 		} else {
-			$('#bigMarkAsRead').attr('href', $('#nav_menu_read_all>a').attr('href'));
+			$('#bigMarkAsRead').attr(
+				'formaction', $('#nav_menu_read_all > .read_all').attr('formaction')
+			);
 		}
 
 		$('[id^=day_]').each(function (i) {

+ 1 - 0
p/themes/base-theme/template.css

@@ -516,6 +516,7 @@ a.btn {
 }
 #bigMarkAsRead {
 	display: block;
+	width: 100%;
 	padding: 3em 0;
 	text-align: center;
 }