Unverified Commit 473cc251 authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff
Browse files

Replace comment_box with comment-box

parent 7457f254
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ app.views.CommentStream = app.views.Base.extend({
  className : "comment_stream",

  events: {
    "keydown .comment_box": "keyDownOnCommentBox",
    "keydown .comment-box": "keyDownOnCommentBox",
    "submit form": "createComment",
    "click .toggle_post_comments": "expandComments",
    "click form": "openForm"
@@ -26,11 +26,11 @@ app.views.CommentStream = app.views.Base.extend({

  postRenderTemplate : function() {
    this.model.comments.each(this.appendComment, this);
    this.commentBox = this.$(".comment_box");
    this.commentBox = this.$(".comment-box");
    this.commentSubmitButton = this.$("input[name='commit']");
    this.mentions = new app.views.CommentMention({el: this.$el, postId: this.model.get("id")});

    this.mdEditor = new Diaspora.MarkdownEditor(this.$(".comment_box"), {
    this.mdEditor = new Diaspora.MarkdownEditor(this.$(".comment-box"), {
      onPreview: function($mdInstance) {
        var renderedText = app.helpers.textFormatter($mdInstance.getContent(), this.mentions.getMentionedPeople());
        return "<div class='preview-content'>" + renderedText + "</div>";
+2 −2
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ app.views.SinglePostActions = app.views.Feedback.extend({
  },

  focusComment: function() {
    $('.comment_stream .comment_box').focus();
    $('html,body').animate({scrollTop: $('.comment_stream .comment_box').offset().top - ($('.comment_stream .comment_box').height() + 20)});
    $('.comment_stream .comment-box').focus();
    $('html,body').animate({scrollTop: $('.comment_stream .comment-box').offset().top - ($('.comment_stream .comment-box').height() + 20)});
    return false;
  },

+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ app.views.StreamPost = app.views.Post.extend({
  focusCommentTextarea: function(evt){
    evt.preventDefault();
    this.$(".new-comment-form-wrapper").removeClass("hidden");
    this.$(".comment_box").focus();
    this.$(".comment-box").focus();

    return this;
  }
+3 −3
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
    initialize: function() {
      var self = this;

      new Diaspora.MarkdownEditor(".comment_box");
      new Diaspora.MarkdownEditor(".comment-box");

      this.stream().on("tap click", "a.show-comments", function(evt){
        evt.preventDefault();
@@ -43,7 +43,7 @@
    submitComment: function(evt){
      evt.preventDefault();
      var form = $(this);
      var commentBox = form.find(".comment_box");
      var commentBox = form.find(".comment-box");
      var commentText = $.trim(commentBox.val());
      if(!commentText){
        commentBox.focus();
@@ -169,7 +169,7 @@

    showCommentBox: function(link){
      var bottomBar = link.closest(".bottom-bar").first();
      var textArea = bottomBar.find("textarea.comment_box").first()[0];
      var textArea = bottomBar.find("textarea.comment-box").first()[0];
      bottomBar.find(".add-comment-switcher").removeClass("hidden");
      autosize(textArea);
    },
+2 −2
Original line number Diff line number Diff line
@@ -53,11 +53,11 @@
    }
    padding-left: 12px;
  }
  .comment_box {
  .comment-box {
    height: 35px;
    resize: none;
  }
  textarea.comment_box:focus, textarea.comment_box:valid, textarea.comment_box:active {
  textarea.comment-box:focus, textarea.comment-box:valid, textarea.comment-box:active {
    border-color: $border-dark-grey;
    box-shadow: none;
  }
Loading