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,7 +8,7 @@
8 {% csrf_token %} 8 {% csrf_token %}
9 <div class="form-group{% if form.has_error %} has-error {% endif %}"> 9 <div class="form-group{% if form.has_error %} has-error {% endif %}">
10 <label for="{{ form.comment.auto_id }}">{{ form.comment.label }} <span>*</span></label> 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 <span id="helpBlock" class="help-block">{{ form.post.help_text }}</span> 13 <span id="helpBlock" class="help-block">{{ form.post.help_text }}</span>
14 14
@@ -128,17 +128,23 @@ @@ -128,17 +128,23 @@
128 var node = document.createElement('span'), 128 var node = document.createElement('span'),
129 value = field.val(); 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 $(node).addClass('marked_user'); 133 $(node).addClass('marked_user');
132 $(node).html(value); 134 $(node).html(value);
133 -  
134 context.invoke('restoreRange'); 135 context.invoke('restoreRange');
135 context.invoke('pasteHTML', node); 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 $(modal).modal('hide'); 141 $(modal).modal('hide');
  142 + //&nbsp;
138 }); 143 });
139 } 144 }
140 }); 145 });
141 146
  147 +
142 return button.render(); // return button as jquery object 148 return button.render(); // return button as jquery object
143 } 149 }
144 150
@@ -152,6 +158,7 @@ @@ -152,6 +158,7 @@
152 ['style', ['bold', 'italic']], 158 ['style', ['bold', 'italic']],
153 ['insert', ['link']], 159 ['insert', ['link']],
154 ['mybuttons', ['addUser']], 160 ['mybuttons', ['addUser']],
  161 + ['color', ['color']],
155 ], 162 ],
156 buttons: { 163 buttons: {
157 addUser: AddUserBtn 164 addUser: AddUserBtn