aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-08-21 14:36:18 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-08-21 14:36:18 +0200
commit9ae0652d9f88610e44be7409c0287bac1327a68e (patch)
tree6ebdb1c002fddb52319de4365f0f67eedb1f9503 /app
parent96a2076d5eab5473eaa6389f669c477ee81bffcb (diff)
Fix issue #131 : pied d'article
Ajout de la date et du lien vers site externe au pied des articles Modification comportement raccourci "up" : si la fenêtre est sous l'article actif, on remonte en haut de cet article. Si la fenêtre est au début de l'article actif ou au-dessus, on remonte en haut de l'écran
Diffstat (limited to 'app')
-rw-r--r--app/layout/nav_entries.phtml2
-rw-r--r--app/views/helpers/view/normal_view.phtml2
-rw-r--r--app/views/javascript/main.phtml12
3 files changed, 15 insertions, 1 deletions
diff --git a/app/layout/nav_entries.phtml b/app/layout/nav_entries.phtml
index 101e7443e..5501f1725 100644
--- a/app/layout/nav_entries.phtml
+++ b/app/layout/nav_entries.phtml
@@ -1,5 +1,5 @@
<ul class="nav_entries">
<li class="item"><a class="previous_entry" href="#"><i class="icon i_prev"></i></a></li>
- <li class="item"><a href="#"><i class="icon i_up"></i></a></li>
+ <li class="item"><a class="up" href="#"><i class="icon i_up"></i></a></li>
<li class="item"><a class="next_entry" href="#"><i class="icon i_next"></i></a></li>
</ul> \ No newline at end of file
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml
index 4f08bea7f..05b2a08e2 100644
--- a/app/views/helpers/view/normal_view.phtml
+++ b/app/views/helpers/view/normal_view.phtml
@@ -114,6 +114,8 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
</div>
</li>
<?php } ?>
+ <li class="item date"><?php echo $item->date (); ?></li>
+ <li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>">&nbsp;</a></li>
</ul>
</div>
</div>
diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml
index 4c128b082..e81ae831a 100644
--- a/app/views/javascript/main.phtml
+++ b/app/views/javascript/main.phtml
@@ -313,6 +313,18 @@ function init_nav_entries() {
next_entry();
return false;
});
+ $('.nav_entries a.up').click(function() {
+ var active_item = $(".flux.active");
+ var windowTop = $(window).scrollTop();
+ var item_top = active_item.position ().top;
+
+ if(windowTop > item_top) {
+ $("html,body").scrollTop (item_top);
+ } else {
+ $("html,body").scrollTop (0);
+ }
+ return false;
+ });
}
$(document).ready (function () {