Commit eb8ee01d by Rocky Duan

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

parent c1cd0758
...@@ -124,7 +124,7 @@ if Backbone? ...@@ -124,7 +124,7 @@ if Backbone?
url = @model.urlFor('retrieve') url = @model.urlFor('retrieve')
DiscussionUtil.safeAjax DiscussionUtil.safeAjax
$elem: $elem $elem: $elem
$loading: $(event.target) if event $loading: @$(".discussion-show-comments")
type: "GET" type: "GET"
url: url url: url
success: (response, textStatus) => success: (response, textStatus) =>
......
$ -> $ ->
$.fn.extend $.fn.extend
loading: -> loading: ->
$(this).after("<span class='discussion-loading'></span>") @$_loading = $("<span class='discussion-loading'></span>")
$(this).after(@$_loading)
loaded: -> loaded: ->
$(this).parent().children(".discussion-loading").remove() @$_loading.remove()
class @DiscussionUtil class @DiscussionUtil
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</div> </div>
<div class="discussion-right-wrapper"> <div class="discussion-right-wrapper">
<ul class="admin-actions"> <ul class="admin-actions">
<li><a href="javascript:void(0)" class="admin-endorse">Endorse</a></li> <li style="display: none;"><a href="javascript:void(0)" class="admin-endorse">Endorse</a></li>
<li><a href="javascript:void(0)" class="admin-edit">Edit</a></li> <li style="display: none;"><a href="javascript:void(0)" class="admin-edit">Edit</a></li>
<li><a href="javascript:void(0)" class="admin-delete">Delete</a></li> <li style="display: none;"><a href="javascript:void(0)" class="admin-delete">Delete</a></li>
{{#thread}} {{#thread}}
<li><a href="javascript:void(0)" class="admin-openclose">{{close_thread_text}}</a></li> <li style="display: none;"><a href="javascript:void(0)" class="admin-openclose">{{close_thread_text}}</a></li>
{{/thread}} {{/thread}}
</ul> </ul>
{{#thread}} {{#thread}}
......
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