Commit d0a339be by Rocky Duan

fixed similar posts suggestion

parent dd80cbc4
...@@ -77,6 +77,7 @@ initializeFollowDiscussion = (discussion) -> ...@@ -77,6 +77,7 @@ initializeFollowDiscussion = (discussion) ->
text: $local(".new-post-title").val() text: $local(".new-post-title").val()
success: (response, textStatus) -> success: (response, textStatus) ->
$similarPosts.empty() $similarPosts.empty()
console.log response
if $.type(response) == "array" and response.length if $.type(response) == "array" and response.length
$wrapper.show() $wrapper.show()
for thread in response for thread in response
......
...@@ -10,6 +10,11 @@ Discussion = @Discussion ...@@ -10,6 +10,11 @@ Discussion = @Discussion
<form class="new-post-form collapsed" id="new-post-form" style="display: block; "> <form class="new-post-form collapsed" id="new-post-form" style="display: block; ">
<ul class="new-post-form-errors discussion-errors"></ul> <ul class="new-post-form-errors discussion-errors"></ul>
<input type="text" class="new-post-title title-input" placeholder="Title" /> <input type="text" class="new-post-title title-input" placeholder="Title" />
<div class="new-post-similar-posts-wrapper" style="display: none">
Similar Posts:
<a class="hide-similar-posts" href="javascript:void(0)">Hide</a>
<div class="new-post-similar-posts"></div>
</div>
<div class="new-post-body reply-body"></div> <div class="new-post-body reply-body"></div>
<input class="new-post-tags" placeholder="Tags" /> <input class="new-post-tags" placeholder="Tags" />
<div class="post-options"> <div class="post-options">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment