Commit 4ebba8c94981dcbd83451ea6e69b63b8e38066da
1 parent
a90968f9
Exists in
master
and in
39 other branches
Adding button to go to reply textarea
Showing
3 changed files
with
21 additions
and
1 deletions
Show diff stats
src/static/css/screen.css
src/super_archives/templates/message-thread.html
... | ... | @@ -68,6 +68,17 @@ |
68 | 68 | $ajax.fail(vote_fail_callback); |
69 | 69 | } |
70 | 70 | |
71 | + function scrollToAnchor(aid){ | |
72 | + var aTag = $(aid); | |
73 | + console.log(aTag); | |
74 | + $('html, body').animate({scrollTop: aTag.offset().top}, 800); | |
75 | + } | |
76 | + | |
77 | + function focus_reply(event) { | |
78 | + scrollToAnchor('#msg-reply'); | |
79 | + $('textarea', '#msg-reply').focus(); | |
80 | + } | |
81 | + | |
71 | 82 | // Binding functions |
72 | 83 | $(function() { |
73 | 84 | $(".panel-heading").on('click', function(event) { |
... | ... | @@ -82,6 +93,7 @@ |
82 | 93 | }); |
83 | 94 | |
84 | 95 | $('.vote.btn', this).on('click', vote); |
96 | + $('.reply.btn', this).on('click', focus_reply); | |
85 | 97 | }); |
86 | 98 | |
87 | 99 | </script> | ... | ... |
src/super_archives/templates/superarchives/includes/message.html
1 | 1 | {% load gravatar superarchives i18n %} |
2 | 2 | <li> |
3 | 3 | {% spaceless %} |
4 | - <div class="email-message" id="msg-{{ email.id }}"> | |
4 | + <div class="email-message" id="msg-{% firstof email.id 'reply' %}"> | |
5 | 5 | <div class="panel panel-default"> |
6 | 6 | <div class="panel-heading clearfix"> |
7 | 7 | <div class="col-lg-6 col-md-6 col-sm-6"> |
... | ... | @@ -34,6 +34,10 @@ |
34 | 34 | <span class="glyphicon glyphicon-thumbs-up"></span> |
35 | 35 | </button> |
36 | 36 | </div> |
37 | + | |
38 | + <button class="btn btn-default reply" title="{% trans 'Reply' %}"> | |
39 | + <span class="glyphicon glyphicon-share"></span> | |
40 | + </button> | |
37 | 41 | </div> |
38 | 42 | </div> |
39 | 43 | {% endif %} | ... | ... |