Skip to content
Snippets Groups Projects
Commit e13333aa authored by Robert Speicher's avatar Robert Speicher
Browse files

Make the loading spinner toggle more explicit

Occasionally the loading spinner would stay visible after the tab
finished loading. This change makes the toggle explicit so that it's
always shown on `beforeSend`, and always hidden on `complete`.

Plus a bonus semi-colon eradication! :boom:
parent ada2c455
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -69,7 +69,7 @@ class @MergeRequestTabs
scrollToElement: (container) ->
if window.location.hash
top = $(container + " " + window.location.hash).offset().top
$('body').scrollTo(top);
$('body').scrollTo(top)
 
# Activate a tab based on the current action
activateTab: (action) ->
Loading
Loading
@@ -139,13 +139,16 @@ class @MergeRequestTabs
@diffsLoaded = true
@scrollToElement(".diffs")
 
toggleLoading: ->
$('.mr-loading-status .loading').toggle()
# Show or hide the loading spinner
#
# status - Boolean, true to show, false to hide
toggleLoading: (status) ->
$('.mr-loading-status .loading').toggle(status)
 
_get: (options) ->
defaults = {
beforeSend: @toggleLoading
complete: @toggleLoading
beforeSend: => @toggleLoading(true)
complete: => @toggleLoading(false)
dataType: 'json'
type: 'GET'
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment