Skip to content

Commit

Permalink
修复评论回复的问题
Browse files Browse the repository at this point in the history
1.修复多次点击评论回复按钮出现多个回复框
2.点击第二层回复后再点击第一层回复时,会把@user带过去。修改后,点击第一层回复时清空回复框。
  • Loading branch information
booxood committed Mar 8, 2014
1 parent dd99112 commit edc0db1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion public/javascripts/editor.js
Expand Up @@ -8,7 +8,10 @@ function createEpicEditor (textarea) {
var $node = $(textarea);
var id = $node.attr('id');
var h = $node.height();
$node.before('<div id="editor_' + id + '" style="height:' + h + 'px; border: 1px solid #DDD; border-radius: 4px;"></div>');
var l = $node.parents('.reply2_form').find('#editor_'+id).length;
if (l == 0) {
$node.before('<div id="editor_' + id + '" style="height:' + h + 'px; border: 1px solid #DDD; border-radius: 4px;"></div>');
}
$node.hide();

var opts = {
Expand Down
2 changes: 1 addition & 1 deletion views/topic/index.html
Expand Up @@ -166,7 +166,7 @@ <h3>
var editorWrap = parent.find('.reply2_form');
parent.find('.reply2_area').prepend(editorWrap);
var textarea = editorWrap.find('textarea.editor');
var user = $btn.parents('.cell').find('.reply_author a').html();
textarea.val('');

editorWrap.show('fast', function () {
var editor = createEpicEditor(textarea);
Expand Down

0 comments on commit edc0db1

Please sign in to comment.