From eb8ee01d21fe50a50454242bc35477eebf0a5153 Mon Sep 17 00:00:00 2001 From: Rocky Duan Date: Sat, 25 Aug 2012 12:12:57 -0700 Subject: [PATCH] fixed a tiny bug that loading icon sometimes doesn't appear at the right place / doesn't go away --- lms/static/coffee/src/discussion/content.coffee | 2 +- lms/static/coffee/src/discussion/utils.coffee | 5 +++-- lms/templates/discussion/mustache/_content.mustache | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lms/static/coffee/src/discussion/content.coffee b/lms/static/coffee/src/discussion/content.coffee index 13d6f1094f..73c3688c2a 100644 --- a/lms/static/coffee/src/discussion/content.coffee +++ b/lms/static/coffee/src/discussion/content.coffee @@ -124,7 +124,7 @@ if Backbone? url = @model.urlFor('retrieve') DiscussionUtil.safeAjax $elem: $elem - $loading: $(event.target) if event + $loading: @$(".discussion-show-comments") type: "GET" url: url success: (response, textStatus) => diff --git a/lms/static/coffee/src/discussion/utils.coffee b/lms/static/coffee/src/discussion/utils.coffee index 94807654c9..0990f0c87c 100644 --- a/lms/static/coffee/src/discussion/utils.coffee +++ b/lms/static/coffee/src/discussion/utils.coffee @@ -1,9 +1,10 @@ $ -> $.fn.extend loading: -> - $(this).after("") + @$_loading = $("") + $(this).after(@$_loading) loaded: -> - $(this).parent().children(".discussion-loading").remove() + @$_loading.remove() class @DiscussionUtil diff --git a/lms/templates/discussion/mustache/_content.mustache b/lms/templates/discussion/mustache/_content.mustache index a5089793e7..b4f3176931 100644 --- a/lms/templates/discussion/mustache/_content.mustache +++ b/lms/templates/discussion/mustache/_content.mustache @@ -7,11 +7,11 @@
{{#thread}}