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
bfaa3edb
Commit
bfaa3edb
authored
Apr 29, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove tree history & ajax slider
parent
ebf6821f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
45 deletions
+7
-45
app/assets/javascripts/tree.js.coffee
app/assets/javascripts/tree.js.coffee
+7
-34
app/views/tree/show.js.haml
app/views/tree/show.js.haml
+0
-11
No files found.
app/assets/javascripts/tree.js.coffee
View file @
bfaa3edb
# Code browser tree slider
# Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
$
(
".tree-content-holder .tree-item"
).
live
'click'
,
(
e
)
->
if
(
e
.
target
.
nodeName
!=
"A"
)
path
=
$
(
'.tree-item-file-name a'
,
this
).
attr
(
'href'
)
Turbolinks
.
visit
(
path
)
$
->
if
$
(
'#tree-slider'
).
length
>
0
# Show the "Loading commit data" for only the first element
$
(
'span.log_loading:first'
).
removeClass
(
'hide'
)
$
(
'#tree-slider .tree-item-file-name a, .breadcrumb li > a'
).
live
"click"
,
->
$
(
"#tree-content-holder"
).
hide
(
"slide"
,
{
direction
:
"left"
},
400
)
# 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"
)
# Maintain forward/back history while browsing the file tree
((
window
)
->
History
=
window
.
History
$
=
window
.
jQuery
document
=
window
.
document
# Check to see if History.js is enabled for our Browser
unless
History
.
enabled
return
false
$
(
'#tree-slider .tree-item-file-name a, .breadcrumb li > a'
).
live
'click'
,
(
e
)
->
History
.
pushState
(
null
,
null
,
decodeURIComponent
(
$
(
@
).
attr
(
'href'
)))
return
false
History
.
Adapter
.
bind
window
,
'statechange'
,
->
state
=
History
.
getState
()
$
.
ajax
({
url
:
state
.
url
,
dataType
:
'script'
,
beforeSend
:
->
$
(
'.tree_progress'
).
addClass
(
"loading"
),
complete
:
->
$
(
'.tree_progress'
).
removeClass
(
"loading"
)
})
)(
window
)
# Show the "Loading commit data" for only the first element
$
(
'span.log_loading:first'
).
removeClass
(
'hide'
)
# See if there are lines selected
# "#L12" and "#L34-56" supported
...
...
app/views/tree/show.js.haml
deleted
100644 → 0
View file @
ebf6821f
:plain
// Load Files list
$("#tree-holder").html("
#{
escape_javascript
(
render
(
partial:
"tree"
,
locals:
{
tree:
@tree
}))
}
");
$("#tree-content-holder").show("slide", { direction: "right" }, 400);
$('.project-refs-form #path').val("
#{
@path
}
");
$(".project-refs-form #destination").val("tree");
// Load last commit log for each file in tree
$('#tree-slider').waitForImages(function() {
ajaxGet('
#{
@logs_path
}
');
});
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