diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-09-03 02:05:06 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-09-03 02:05:06 +0200 |
commit | 83ccb14e284f1ef3fe0c78ce705fa8fb15bb505a (patch) | |
tree | c127d355dd807e831158f9f07b8f416b698016fb /ishtar_common/static/js/ishtar.js | |
parent | f7abfdbcc4066121d79bd09a389535a19359edc1 (diff) | |
download | Ishtar-83ccb14e284f1ef3fe0c78ce705fa8fb15bb505a.tar.bz2 Ishtar-83ccb14e284f1ef3fe0c78ce705fa8fb15bb505a.zip |
UI: add arrow to scroll to bottom or to scroll to top
Diffstat (limited to 'ishtar_common/static/js/ishtar.js')
-rw-r--r-- | ishtar_common/static/js/ishtar.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index c26c8a7d9..08e500425 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -23,7 +23,6 @@ beforeSend: function(xhr, settings) { } }}); - $(document).ready(function(){ $("#main_menu > ul > li > ul").hide(); $("#main_menu ul ul .selected").parents().show(); @@ -38,6 +37,18 @@ $(document).ready(function(){ {item:'operation', value:$("#current_operation").val()} ); }); + if ($(document).height() < 1.5*$(window).height()){ + $('#to_bottom_arrow').hide(); + $('#to_top_arrow').hide(); + } +}); + +$('#to_bottom_arrow').live('click', function(){ + $("html, body").animate({ scrollTop: $(document).height() }, 1000); +}); + +$('#to_top_arrow').live('click', function(){ + $("html, body").animate({ scrollTop: 0}, 1000); }); $("#main_menu ul li").live('click', function(){ |