fixed a tiny bug that loading icon sometimes doesn't appear at the right place / doesn't go away

This commit is contained in:
Rocky Duan
2012-08-25 12:12:57 -07:00
parent c1cd075853
commit eb8ee01d21
3 changed files with 8 additions and 7 deletions

View File

@@ -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) =>

View File

@@ -1,9 +1,10 @@
$ ->
$.fn.extend
loading: ->
$(this).after("<span class='discussion-loading'></span>")
@$_loading = $("<span class='discussion-loading'></span>")
$(this).after(@$_loading)
loaded: ->
$(this).parent().children(".discussion-loading").remove()
@$_loading.remove()
class @DiscussionUtil