From a40c8fad2d78df49e6353addaf2d15528eb2a55d Mon Sep 17 00:00:00 2001 From: Ibrahim Awwal Date: Thu, 6 Sep 2012 19:04:56 -0700 Subject: [PATCH] Fix inline thread rendering when expanding and contracting. --- lms/static/coffee/src/discussion/discussion.coffee | 9 ++++----- .../views/discussion_thread_inline_view.coffee | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lms/static/coffee/src/discussion/discussion.coffee b/lms/static/coffee/src/discussion/discussion.coffee index 002593855c..2944449f61 100644 --- a/lms/static/coffee/src/discussion/discussion.coffee +++ b/lms/static/coffee/src/discussion/discussion.coffee @@ -7,7 +7,6 @@ if Backbone? item.discussion = @ @comparator = @sortByDateRecentFirst @on "thread:remove", (thread) => - console.log "remove triggered" @remove(thread) find: (id) -> @@ -24,8 +23,8 @@ if Backbone? sortByDateRecentFirst: (thread) -> -(new Date(thread.get("created_at")).getTime()) - #return String.fromCharCode.apply(String, - # _.map(thread.get("created_at").split(""), + #return String.fromCharCode.apply(String, + # _.map(thread.get("created_at").split(""), # ((c) -> return 0xffff - c.charChodeAt())) #) @@ -134,7 +133,7 @@ if Backbone? @$(".discussion-submit-post").click $.proxy(@submitNewPost, @) @$(".discussion-cancel-post").click $.proxy(@cancelNewPost, @) - + @$el.children(".blank").hide() @$(".new-post-form").show() @@ -177,7 +176,7 @@ if Backbone? threadView = new ThreadView el: $thread[0], model: thread thread.updateInfo response.annotated_content_info @cancelNewPost() - + cancelNewPost: (event) -> if @$el.hasClass("inline-discussion") diff --git a/lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee b/lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee index b7ce771eeb..76037d7341 100644 --- a/lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee +++ b/lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee @@ -194,6 +194,7 @@ class @DiscussionThreadInlineView extends DiscussionContentView expandPost: (event) -> @expanded = true @$el.find('.post-body').html(@model.get('body')) + @convertMath() @$el.find('.expand-post').hide() @$el.find('.collapse-post').show() @$el.find('.post-extended-content').show() @@ -204,6 +205,7 @@ class @DiscussionThreadInlineView extends DiscussionContentView collapsePost: (event) -> @expanded = false @$el.find('.post-body').html(@model.get('abbreviatedBody')) + @convertMath() @$el.find('.collapse-post').hide() @$el.find('.post-extended-content').hide() @$el.find('.expand-post').show()