Skip to content
Browse files

修复评论回复的问题

1.修复多次点击评论回复按钮出现多个回复框
2.点击第二层回复后再点击第一层回复时,会把@user带过去。修改后,点击第一层回复时清空回复框。
  • Loading branch information...
1 parent dd99112 commit edc0db1a705046797a1c582fe3dea3f51d35f865 @booxood booxood committed
Showing with 5 additions and 2 deletions.
  1. +4 −1 public/javascripts/editor.js
  2. +1 −1 views/topic/index.html
View
5 public/javascripts/editor.js
@@ -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 = {
View
2 views/topic/index.html
@@ -166,7 +166,7 @@
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);

0 comments on commit edc0db1

Please sign in to comment.
Something went wrong with that request. Please try again.