Fix loading animation while browsing tree
This commit is contained in:
parent
e38e2ce29a
commit
40f1868194
2 changed files with 9 additions and 10 deletions
|
@ -11,12 +11,7 @@ $ ->
|
||||||
# Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
|
# Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
|
||||||
$("#tree-slider .tree-item").live 'click', (e) ->
|
$("#tree-slider .tree-item").live 'click', (e) ->
|
||||||
$('.tree-item-file-name a', this).trigger('click') if (e.target.nodeName != "A")
|
$('.tree-item-file-name a', this).trigger('click') if (e.target.nodeName != "A")
|
||||||
|
|
||||||
# Show/Hide the loading spinner
|
|
||||||
$('#tree-slider .tree-item-file-name a, .breadcrumb a, .project-refs-form').live
|
|
||||||
"ajax:beforeSend": -> $('.tree_progress').addClass("loading")
|
|
||||||
"ajax:complete": -> $('.tree_progress').removeClass("loading")
|
|
||||||
|
|
||||||
# Maintain forward/back history while browsing the file tree
|
# Maintain forward/back history while browsing the file tree
|
||||||
((window) ->
|
((window) ->
|
||||||
History = window.History
|
History = window.History
|
||||||
|
@ -33,7 +28,12 @@ $ ->
|
||||||
|
|
||||||
History.Adapter.bind window, 'statechange', ->
|
History.Adapter.bind window, 'statechange', ->
|
||||||
state = History.getState()
|
state = History.getState()
|
||||||
window.ajaxGet(state.url)
|
$.ajax({
|
||||||
|
url: state.url,
|
||||||
|
dataType: 'script',
|
||||||
|
beforeSend: -> $('.tree_progress').addClass("loading"),
|
||||||
|
complete: -> $('.tree_progress').removeClass("loading")
|
||||||
|
})
|
||||||
)(window)
|
)(window)
|
||||||
|
|
||||||
# See if there are lines selected
|
# See if there are lines selected
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
- else
|
- else
|
||||||
= link_to title, '#'
|
= link_to title, '#'
|
||||||
|
|
||||||
.clear
|
|
||||||
%div.tree_progress
|
|
||||||
|
|
||||||
%div#tree-content-holder.tree-content-holder
|
%div#tree-content-holder.tree-content-holder
|
||||||
- if tree.is_blob?
|
- if tree.is_blob?
|
||||||
= render "tree/blob", blob: tree
|
= render "tree/blob", blob: tree
|
||||||
|
@ -40,6 +37,8 @@
|
||||||
- if tree.readme
|
- if tree.readme
|
||||||
= render "tree/readme", readme: tree.readme
|
= render "tree/readme", readme: tree.readme
|
||||||
|
|
||||||
|
%div.tree_progress
|
||||||
|
|
||||||
- unless tree.is_blob?
|
- unless tree.is_blob?
|
||||||
:javascript
|
:javascript
|
||||||
// Load last commit log for each file in tree
|
// Load last commit log for each file in tree
|
||||||
|
|
Loading…
Reference in a new issue