From 867efeb80f1f8c02773a6b8266adca4ea3b172fd Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 18 Aug 2013 18:16:39 +0200 Subject: [PATCH] Add comment focus button. --- .../views/single-post-viewer/single_post_actions.js | 13 +++++++++++++ app/assets/stylesheets/entypo.css.scss | 4 ++++ .../single-post-actions_tpl.jst.hbs | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js b/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js index 054ddf150..826814fcb 100644 --- a/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js +++ b/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js @@ -1,3 +1,16 @@ app.views.SinglePostActions = app.views.Feedback.extend({ templateName: "single-post-viewer/single-post-actions", + + events: function() { + return _.defaults({ + "click .focus-comment" : "focusComment" + }, app.views.Feedback.prototype.events); + }, + + focusComment: function() { + $('.comment_box').focus(); + $("html, body").animate({ scrollTop: $(document).height()-$(window).height() }); // Go to the bottom. + return false; + } + }); diff --git a/app/assets/stylesheets/entypo.css.scss b/app/assets/stylesheets/entypo.css.scss index 0333b6fe3..efb3b361c 100644 --- a/app/assets/stylesheets/entypo.css.scss +++ b/app/assets/stylesheets/entypo.css.scss @@ -15,6 +15,10 @@ content: '\e717'; } + &.comment:before { + content: '\e718'; + } + &.red { color: #A40802; } diff --git a/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs b/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs index 0d73615ae..cad10b5ec 100644 --- a/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs +++ b/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs @@ -20,5 +20,9 @@ {{/if}} {{/if}} + + + +