Commit a40c8fad by Ibrahim Awwal

Fix inline thread rendering when expanding and contracting.

parent b33ef47d
...@@ -7,7 +7,6 @@ if Backbone? ...@@ -7,7 +7,6 @@ if Backbone?
item.discussion = @ item.discussion = @
@comparator = @sortByDateRecentFirst @comparator = @sortByDateRecentFirst
@on "thread:remove", (thread) => @on "thread:remove", (thread) =>
console.log "remove triggered"
@remove(thread) @remove(thread)
find: (id) -> find: (id) ->
...@@ -24,8 +23,8 @@ if Backbone? ...@@ -24,8 +23,8 @@ if Backbone?
sortByDateRecentFirst: (thread) -> sortByDateRecentFirst: (thread) ->
-(new Date(thread.get("created_at")).getTime()) -(new Date(thread.get("created_at")).getTime())
#return String.fromCharCode.apply(String, #return String.fromCharCode.apply(String,
# _.map(thread.get("created_at").split(""), # _.map(thread.get("created_at").split(""),
# ((c) -> return 0xffff - c.charChodeAt())) # ((c) -> return 0xffff - c.charChodeAt()))
#) #)
...@@ -134,7 +133,7 @@ if Backbone? ...@@ -134,7 +133,7 @@ if Backbone?
@$(".discussion-submit-post").click $.proxy(@submitNewPost, @) @$(".discussion-submit-post").click $.proxy(@submitNewPost, @)
@$(".discussion-cancel-post").click $.proxy(@cancelNewPost, @) @$(".discussion-cancel-post").click $.proxy(@cancelNewPost, @)
@$el.children(".blank").hide() @$el.children(".blank").hide()
@$(".new-post-form").show() @$(".new-post-form").show()
...@@ -177,7 +176,7 @@ if Backbone? ...@@ -177,7 +176,7 @@ if Backbone?
threadView = new ThreadView el: $thread[0], model: thread threadView = new ThreadView el: $thread[0], model: thread
thread.updateInfo response.annotated_content_info thread.updateInfo response.annotated_content_info
@cancelNewPost() @cancelNewPost()
cancelNewPost: (event) -> cancelNewPost: (event) ->
if @$el.hasClass("inline-discussion") if @$el.hasClass("inline-discussion")
......
...@@ -194,6 +194,7 @@ class @DiscussionThreadInlineView extends DiscussionContentView ...@@ -194,6 +194,7 @@ class @DiscussionThreadInlineView extends DiscussionContentView
expandPost: (event) -> expandPost: (event) ->
@expanded = true @expanded = true
@$el.find('.post-body').html(@model.get('body')) @$el.find('.post-body').html(@model.get('body'))
@convertMath()
@$el.find('.expand-post').hide() @$el.find('.expand-post').hide()
@$el.find('.collapse-post').show() @$el.find('.collapse-post').show()
@$el.find('.post-extended-content').show() @$el.find('.post-extended-content').show()
...@@ -204,6 +205,7 @@ class @DiscussionThreadInlineView extends DiscussionContentView ...@@ -204,6 +205,7 @@ class @DiscussionThreadInlineView extends DiscussionContentView
collapsePost: (event) -> collapsePost: (event) ->
@expanded = false @expanded = false
@$el.find('.post-body').html(@model.get('abbreviatedBody')) @$el.find('.post-body').html(@model.get('abbreviatedBody'))
@convertMath()
@$el.find('.collapse-post').hide() @$el.find('.collapse-post').hide()
@$el.find('.post-extended-content').hide() @$el.find('.post-extended-content').hide()
@$el.find('.expand-post').show() @$el.find('.expand-post').show()
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