瀏覽代碼

Correction comportement JS

L'ouverture d'un article sur le site d'origine via le raccourci
fonctionne de nouveau normalement

Lorsque la connexion est paramétrée et la lecture anonyme autorisée, une
personne non connectée pouvait avoir l'impression de marquer des
articles comme (non) lus (mais ça n'était pas effectif après un
rafraichissement de la page). Les articles ne peuvent plus être marqués
désormais
Marien Fressinaud 12 年之前
父節點
當前提交
29873ed1ef
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      app/views/javascript/main.phtml

+ 9 - 9
app/views/javascript/main.phtml

@@ -58,12 +58,6 @@ function mark_read (active, only_not_read) {
 		return false;
 		return false;
 	}
 	}
 
 
-	if (active.hasClass ("not_read")) {
-		active.removeClass ("not_read");
-	} else {
-		active.addClass ("not_read");
-	}
-
 	url =  active.find ("a.read").attr ("href");
 	url =  active.find ("a.read").attr ("href");
 	if (url === undefined) {
 	if (url === undefined) {
 		return false;
 		return false;
@@ -77,6 +71,12 @@ function mark_read (active, only_not_read) {
 		res = jQuery.parseJSON(data);
 		res = jQuery.parseJSON(data);
 
 
 		active.find ("a.read").attr ("href", res.url);
 		active.find ("a.read").attr ("href", res.url);
+
+		if (active.hasClass ("not_read")) {
+			active.removeClass ("not_read");
+		} else {
+			active.addClass ("not_read");
+		}
 	});
 	});
 }
 }
 
 
@@ -85,7 +85,7 @@ function mark_favorite (active) {
 		return false;
 		return false;
 	}
 	}
 
 
-	url =  active.find ("a.bookmark").attr ("href");
+	url = active.find ("a.bookmark").attr ("href");
 	if (url === undefined) {
 	if (url === undefined) {
 		return false;
 		return false;
 	}
 	}
@@ -290,7 +290,7 @@ function init_shortcuts () {
 		'disable_in_input':true
 		'disable_in_input':true
 	});
 	});
 	shortcut.add("<?php echo $s['go_website']; ?>", function () {
 	shortcut.add("<?php echo $s['go_website']; ?>", function () {
-		url = $(".flux.active .link a").attr ("href");
+		url_website = $(".flux.active .link a").attr ("href");
 
 
 		<?php if ($mark['site'] == 'yes') { ?>
 		<?php if ($mark['site'] == 'yes') { ?>
 		$(".flux.active").each (function () {
 		$(".flux.active").each (function () {
@@ -298,7 +298,7 @@ function init_shortcuts () {
 		});
 		});
 		<?php } ?>
 		<?php } ?>
 
 
-		redirect (url, true);
+		redirect (url_website, true);
 	}, {
 	}, {
 		'disable_in_input':true
 		'disable_in_input':true
 	});
 	});