Commit 5c457d70 by Rocky Duan

slight changes

parent 10e9c63a
...@@ -27,7 +27,6 @@ Discussion = @Discussion ...@@ -27,7 +27,6 @@ Discussion = @Discussion
Discussion.makeWmdEditor $content, $local, "reply-body" Discussion.makeWmdEditor $content, $local, "reply-body"
$local(".discussion-submit-post").click -> handleSubmitReply(this) $local(".discussion-submit-post").click -> handleSubmitReply(this)
$local(".discussion-cancel-post").click -> handleCancelReply(this) $local(".discussion-cancel-post").click -> handleCancelReply(this)
$local(".discussion-link").hide()
$discussionContent.attr("status", "reply") $discussionContent.attr("status", "reply")
handleCancelReply = (elem) -> handleCancelReply = (elem) ->
...@@ -61,7 +60,6 @@ Discussion = @Discussion ...@@ -61,7 +60,6 @@ Discussion = @Discussion
anonymous: anonymous anonymous: anonymous
autowatch: autowatch autowatch: autowatch
success: Discussion.formErrorHandler($local(".discussion-errors"), (response, textStatus) -> success: Discussion.formErrorHandler($local(".discussion-errors"), (response, textStatus) ->
console.log response
$comment = $(response.html) $comment = $(response.html)
$content.children(".comments").prepend($comment) $content.children(".comments").prepend($comment)
Discussion.setWmdContent $content, $local, "reply-body", "" Discussion.setWmdContent $content, $local, "reply-body", ""
......
...@@ -104,7 +104,6 @@ initializeFollowThread = (index, thread) -> ...@@ -104,7 +104,6 @@ initializeFollowThread = (index, thread) ->
body: body body: body
tags: tags tags: tags
success: Discussion.formErrorHandler($local(".new-post-form-error"), (response, textStatus) -> success: Discussion.formErrorHandler($local(".new-post-form-error"), (response, textStatus) ->
console.log response
$thread = $(response.html) $thread = $(response.html)
$discussion.children(".threads").prepend($thread) $discussion.children(".threads").prepend($thread)
Discussion.setWmdContent $discussion, $local, "new-post-body", "" Discussion.setWmdContent $discussion, $local, "new-post-body", ""
......
...@@ -92,7 +92,6 @@ wmdEditors = {} ...@@ -92,7 +92,6 @@ wmdEditors = {}
imageUploadUrl = Discussion.urlFor('upload') imageUploadUrl = Discussion.urlFor('upload')
editor = Markdown.makeWmdEditor elem, appended_id, imageUploadUrl editor = Markdown.makeWmdEditor elem, appended_id, imageUploadUrl
wmdEditors["#{cls_identifier}-#{id}"] = editor wmdEditors["#{cls_identifier}-#{id}"] = editor
console.log wmdEditors
editor editor
getWmdEditor: ($content, $local, cls_identifier) -> getWmdEditor: ($content, $local, cls_identifier) ->
...@@ -106,8 +105,6 @@ wmdEditors = {} ...@@ -106,8 +105,6 @@ wmdEditors = {}
setWmdContent: ($content, $local, cls_identifier, text) -> setWmdContent: ($content, $local, cls_identifier, text) ->
id = $content.attr("_id") id = $content.attr("_id")
$local("#wmd-input-#{cls_identifier}-#{id}").val(text) $local("#wmd-input-#{cls_identifier}-#{id}").val(text)
console.log wmdEditors
console.log "#{cls_identifier}-#{id}"
wmdEditors["#{cls_identifier}-#{id}"].refreshPreview() wmdEditors["#{cls_identifier}-#{id}"].refreshPreview()
getContentInfo: (id, attr) -> getContentInfo: (id, attr) ->
......
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