diff --git a/src/static/css/screen.css b/src/static/css/screen.css index 28c5377..88b1f95 100644 --- a/src/static/css/screen.css +++ b/src/static/css/screen.css @@ -216,6 +216,10 @@ ul.unstyled-list .glyphicon-chevron-right { margin-top: 1em; } +.reply.btn { + margin-left: 1em; +} + .email-message pre { border: 0; background-color: #fff; diff --git a/src/super_archives/templates/message-thread.html b/src/super_archives/templates/message-thread.html index 4c7581c..7a2fcc1 100644 --- a/src/super_archives/templates/message-thread.html +++ b/src/super_archives/templates/message-thread.html @@ -68,6 +68,17 @@ $ajax.fail(vote_fail_callback); } + function scrollToAnchor(aid){ + var aTag = $(aid); + console.log(aTag); + $('html, body').animate({scrollTop: aTag.offset().top}, 800); + } + + function focus_reply(event) { + scrollToAnchor('#msg-reply'); + $('textarea', '#msg-reply').focus(); + } + // Binding functions $(function() { $(".panel-heading").on('click', function(event) { @@ -82,6 +93,7 @@ }); $('.vote.btn', this).on('click', vote); + $('.reply.btn', this).on('click', focus_reply); }); diff --git a/src/super_archives/templates/superarchives/includes/message.html b/src/super_archives/templates/superarchives/includes/message.html index 0fb805f..0159199 100644 --- a/src/super_archives/templates/superarchives/includes/message.html +++ b/src/super_archives/templates/superarchives/includes/message.html @@ -1,7 +1,7 @@ {% load gravatar superarchives i18n %}