From 50b34fb414b3a5a15a445e8a71bec1efbc1ecde2 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 8 Dec 2012 17:37:08 +0100 Subject: Ajout mode lecture (en js par contre) fix issue #6 --- app/controllers/indexController.php | 1 + app/views/javascript/main.phtml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 57d37e0f5..7d42de67a 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -6,6 +6,7 @@ class indexController extends ActionController { View::appendScript (Url::display ('/scripts/shortcut.js')); View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main'))); View::appendScript (Url::display ('/scripts/endless_mode.js')); + View::appendScript (Url::display ('/scripts/read_mode.js')); $entryDAO = new EntryDAO (); $catDAO = new CategoryDAO (); diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 1fb30feb1..2bc6f4abb 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -20,7 +20,7 @@ function slide (new_active, old_active) { old_active.removeClass ("active"); new_active.addClass ("active"); - if (hide_posts) { + if (hide_posts && !read_mode_on ) { old_active.children (".content").slideUp (500); new_active.children (".content").slideDown (500, function () { $.smoothScroll({ @@ -29,7 +29,7 @@ function slide (new_active, old_active) { }); } else { $.smoothScroll({ - offset: new_active.position ().top - 50 + offset: new_active.position ().top }); } } @@ -104,7 +104,7 @@ function mark_favorite (active) { } function init_posts () { - if (hide_posts) { + if (hide_posts && !read_mode_on) { $(".post.flux:not(.active) .content").slideUp (); } -- cgit v1.2.3