Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

修复评论回复的问题 #290

Merged
merged 1 commit into from

2 participants

@booxood

1.修复多次点击评论回复按钮出现多个回复框
2.点击第二层回复后再点击第一层回复时,会把@user带过去。修改后,点击第一层回复时清空回复框。

@booxood booxood 修复评论回复的问题
1.修复多次点击评论回复按钮出现多个回复框
2.点击第二层回复后再点击第一层回复时,会把@user带过去。修改后,点击第一层回复时清空回复框。
edc0db1
@alsotang
Owner

thx

@alsotang alsotang merged commit ddd0a4a into cnodejs:master
@booxood

动作真快!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 8, 2014
  1. @booxood

    修复评论回复的问题

    booxood authored
    1.修复多次点击评论回复按钮出现多个回复框
    2.点击第二层回复后再点击第一层回复时,会把@user带过去。修改后,点击第一层回复时清空回复框。
This page is out of date. Refresh to see the latest.
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);
Something went wrong with that request. Please try again.