diff --git a/client/js/shout.js b/client/js/shout.js index 0e8e427a..d9abddb0 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -497,7 +497,7 @@ $(function() { }); }); - chat.on("click", ".messages", function() { + chat.on("click", ".messages, .show-more", function() { setTimeout(function() { var text = ""; if (window.getSelection) { @@ -815,6 +815,24 @@ $(function() { } }); + Mousetrap.bind([ + "pageup", + "pagedown" + ], function(e, keys) { + var el = $(".active > .chat"); + switch (keys) { + case "pageup": + var offsetUp = el.scrollTop() - 24 * 3; + el.finish().animate({scrollTop: offsetUp}, "fast" , "linear"); + break; + + case "pagedown": + var offsetDown = el.scrollTop() + 24 * 3; + el.finish().animate({scrollTop: offsetDown}, "fast" , "linear"); + break; + } + }); + setInterval(function() { chat.find(".chan:not(.active)").each(function() { var chan = $(this);