Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
40f18681
Commit
40f18681
authored
Mar 06, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix loading animation while browsing tree
parent
e38e2ce2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
app/assets/javascripts/tree.js.coffee
app/assets/javascripts/tree.js.coffee
+7
-7
app/views/tree/_tree.html.haml
app/views/tree/_tree.html.haml
+2
-3
No files found.
app/assets/javascripts/tree.js.coffee
View file @
40f18681
...
...
@@ -11,12 +11,7 @@ $ ->
# 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-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
((
window
)
->
History
=
window
.
History
...
...
@@ -33,7 +28,12 @@ $ ->
History
.
Adapter
.
bind
window
,
'statechange'
,
->
state
=
History
.
getState
()
window
.
ajaxGet
(
state
.
url
)
$
.
ajax
({
url
:
state
.
url
,
dataType
:
'script'
,
beforeSend
:
->
$
(
'.tree_progress'
).
addClass
(
"loading"
),
complete
:
->
$
(
'.tree_progress'
).
removeClass
(
"loading"
)
})
)(
window
)
# See if there are lines selected
...
...
app/views/tree/_tree.html.haml
View file @
40f18681
...
...
@@ -11,9 +11,6 @@
-
else
=
link_to
title
,
'#'
.clear
%div
.tree_progress
%div
#tree-content-holder
.tree-content-holder
-
if
tree
.
is_blob?
=
render
"tree/blob"
,
blob:
tree
...
...
@@ -40,6 +37,8 @@
-
if
tree
.
readme
=
render
"tree/readme"
,
readme:
tree
.
readme
%div
.tree_progress
-
unless
tree
.
is_blob?
:javascript
// Load last commit log for each file in tree
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment