ソースを参照

Suppression de l'effet de slide lors du parcours des articles (passage au système de Google Reader)

Marien Fressinaud 13 年 前
コミット
e83a3063d1
2 ファイル変更18 行追加13 行削除
  1. 17 12
      app/views/javascript/main.phtml
  2. 1 1
      public/theme/base.css

+ 17 - 12
app/views/javascript/main.phtml

@@ -24,16 +24,12 @@ function slide (new_active, old_active) {
 	new_active.addClass ("active");
 	new_active.addClass ("active");
 
 
 	if (hide_posts) {
 	if (hide_posts) {
-		old_active.children (".content").slideUp (500);
-		new_active.children (".content").slideDown (500, function () {
-			$.smoothScroll({
-				offset: new_active.position ().top
-			});
+		old_active.children (".content").toggle (0);
+		new_active.children (".content").toggle (0, function () {
+			$("html,body").scrollTop (new_active.position ().top);
 		});
 		});
 	} else {
 	} else {
-		$.smoothScroll({
-			offset: new_active.position ().top
-		});
+		$("html,body").scrollTop (new_active.position ().top);
 	}
 	}
 
 
 	<?php if ($mark['article'] == 'yes') { ?>
 	<?php if ($mark['article'] == 'yes') { ?>
@@ -53,6 +49,7 @@ function mark_read (active, only_not_read) {
 
 
 	url =  active.find ("a.read").attr ("href");
 	url =  active.find ("a.read").attr ("href");
 	if (url === undefined) {
 	if (url === undefined) {
+		load = false;
 		return false;
 		return false;
 	}
 	}
 
 
@@ -75,12 +72,16 @@ function mark_read (active, only_not_read) {
 }
 }
 
 
 function mark_favorite (active) {
 function mark_favorite (active) {
-	if (active[0] === undefined) {
+	if (active[0] === undefined ||
+	    load === true) {
 		return false;
 		return false;
 	}
 	}
 
 
+	load = true;
+
 	url =  active.find ("a.bookmark").attr ("href");
 	url =  active.find ("a.bookmark").attr ("href");
 	if (url === undefined) {
 	if (url === undefined) {
+		load = false;
 		return false;
 		return false;
 	}
 	}
 
 
@@ -97,6 +98,8 @@ function mark_favorite (active) {
 		} else {
 		} else {
 			active.addClass ("favorite");
 			active.addClass ("favorite");
 		}
 		}
+
+		load = false;
 	});
 	});
 }
 }
 
 
@@ -119,7 +122,7 @@ function init_posts () {
 	init_img ();
 	init_img ();
 
 
 	if (hide_posts) {
 	if (hide_posts) {
-		$(".flux:not(.active) .content").slideUp ();
+		$(".flux:not(.active) .content").hide ();
 	}
 	}
 
 
 	$(".flux").click (function () {
 	$(".flux").click (function () {
@@ -206,7 +209,8 @@ $(document).ready (function () {
 
 
 		if (new_active.hasClass("flux")) {
 		if (new_active.hasClass("flux")) {
 			slide (new_active, old_active);
 			slide (new_active, old_active);
-		} else if (new_active[0] === undefined) {
+		} else if (old_active[0] === undefined &&
+		           new_active[0] === undefined) {
 			slide (last_active, old_active);
 			slide (last_active, old_active);
 		}
 		}
 	}, {
 	}, {
@@ -229,7 +233,8 @@ $(document).ready (function () {
 
 
 		if (new_active.hasClass("flux")) {
 		if (new_active.hasClass("flux")) {
 			slide (new_active, old_active);
 			slide (new_active, old_active);
-		} else if (new_active[0] === undefined) {
+		} else if (old_active[0] === undefined &&
+		           new_active[0] === undefined) {
 			slide (first_active, old_active);
 			slide (first_active, old_active);
 		}
 		}
 	}, {
 	}, {

+ 1 - 1
public/theme/base.css

@@ -66,7 +66,7 @@ label {
 	font-size: 14px;
 	font-size: 14px;
 	line-height: 25px;
 	line-height: 25px;
 }
 }
-input {
+input, select {
 	display: inline-block;
 	display: inline-block;
 	min-height: 25px;
 	min-height: 25px;
 	padding: 5px;
 	padding: 5px;