Commit 4ebba8c94981dcbd83451ea6e69b63b8e38066da

Authored by Sergio Oliveira
1 parent a90968f9

Adding button to go to reply textarea

src/static/css/screen.css
... ... @@ -216,6 +216,10 @@ ul.unstyled-list .glyphicon-chevron-right {
216 216 margin-top: 1em;
217 217 }
218 218  
  219 +.reply.btn {
  220 + margin-left: 1em;
  221 +}
  222 +
219 223 .email-message pre {
220 224 border: 0;
221 225 background-color: #fff;
... ...
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 %}
... ...