Commit 1cc31c9ac4338bd740eb5c5699b3c3bb681a2092

Authored by Gustavo
1 parent af7d7ce7

Fix'd comment mark bug

Showing 1 changed file with 10 additions and 3 deletions   Show diff stats
mural/templates/mural/_form_comment.html 100644 → 100755
... ... @@ -8,7 +8,7 @@
8 8 {% csrf_token %}
9 9 <div class="form-group{% if form.has_error %} has-error {% endif %}">
10 10 <label for="{{ form.comment.auto_id }}">{{ form.comment.label }} <span>*</span></label>
11   - {% render_field form.comment class='form-control text_simple_wysiwyg' %}
  11 + {% render_field form.comment class='form-control text_simple_wysiwyg' id='main_comment'%}
12 12  
13 13 <span id="helpBlock" class="help-block">{{ form.post.help_text }}</span>
14 14  
... ... @@ -128,17 +128,23 @@
128 128 var node = document.createElement('span'),
129 129 value = field.val();
130 130  
  131 + var paragraph = document.querySelector("#comment-form > div:nth-child(2) > div > div.note-editing-area > div.note-editable.panel-body > p")
  132 +
131 133 $(node).addClass('marked_user');
132 134 $(node).html(value);
133   -
134 135 context.invoke('restoreRange');
135 136 context.invoke('pasteHTML', node);
136   -
  137 + $('#comment-form > div:nth-child(2) > div > div.note-editing-area > div.note-editable.panel-body > p > br').remove();
  138 + paragraph.innerHTML += '&nbsp;'
  139 + //paragraph.focus();
  140 + //paragraph.caretTo(paragraph.length);
137 141 $(modal).modal('hide');
  142 + //&nbsp;
138 143 });
139 144 }
140 145 });
141 146  
  147 +
142 148 return button.render(); // return button as jquery object
143 149 }
144 150  
... ... @@ -152,6 +158,7 @@
152 158 ['style', ['bold', 'italic']],
153 159 ['insert', ['link']],
154 160 ['mybuttons', ['addUser']],
  161 + ['color', ['color']],
155 162 ],
156 163 buttons: {
157 164 addUser: AddUserBtn
... ...