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
Léo-Paul Géneau
gitlab-ce
Commits
5a097455
Commit
5a097455
authored
Jun 22, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use jQuery objects in ref dropdown
parent
9676421d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+4
-3
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+12
-9
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
5a097455
...
@@ -280,7 +280,7 @@ class GitLabDropdown
...
@@ -280,7 +280,7 @@ class GitLabDropdown
html
=
@
renderData
(
data
)
html
=
@
renderData
(
data
)
# Render the full menu
# Render the full menu
full_html
=
@
renderMenu
(
html
.
join
(
""
)
)
full_html
=
@
renderMenu
(
html
)
@
appendMenu
(
full_html
)
@
appendMenu
(
full_html
)
...
@@ -351,7 +351,8 @@ class GitLabDropdown
...
@@ -351,7 +351,8 @@ class GitLabDropdown
if
@
options
.
renderMenu
if
@
options
.
renderMenu
menu_html
=
@
options
.
renderMenu
(
html
)
menu_html
=
@
options
.
renderMenu
(
html
)
else
else
menu_html
=
"<ul>
#{
html
}
</ul>"
menu_html
=
$
(
'<ul />'
)
.
append
(
html
)
return
menu_html
return
menu_html
...
@@ -360,7 +361,7 @@ class GitLabDropdown
...
@@ -360,7 +361,7 @@ class GitLabDropdown
selector
=
'.dropdown-content'
selector
=
'.dropdown-content'
if
@
dropdown
.
find
(
".dropdown-toggle-page"
).
length
if
@
dropdown
.
find
(
".dropdown-toggle-page"
).
length
selector
=
".dropdown-page-one .dropdown-content"
selector
=
".dropdown-page-one .dropdown-content"
$
(
selector
,
@
dropdown
).
html
html
$
(
selector
,
@
dropdown
).
append
html
# Render the row
# Render the row
renderItem
:
(
data
,
group
=
false
,
index
=
false
)
->
renderItem
:
(
data
,
group
=
false
,
index
=
false
)
->
...
...
app/assets/javascripts/project.js.coffee
View file @
5a097455
...
@@ -70,17 +70,20 @@ class @Project
...
@@ -70,17 +70,20 @@ class @Project
fieldName
:
'ref'
fieldName
:
'ref'
renderRow
:
(
ref
)
->
renderRow
:
(
ref
)
->
if
ref
.
header
?
if
ref
.
header
?
"<li class='dropdown-header'>
#{
ref
.
header
}
</li>"
$
(
'<li />'
)
.
addClass
'dropdown-header'
.
text
ref
.
header
else
else
isActiveClass
=
if
ref
is
selected
then
'is-active'
else
''
link
=
$
(
'<a />'
)
.
attr
'href'
,
'#'
"<li>
.
addClass
(
if
ref
is
selected
then
'is-active'
else
''
)
<a href='#' data-ref='
#{
escape
(
ref
)
}
' class='
#{
isActiveClass
}
'>
.
text
ref
#{
ref
}
.
attr
'data-ref'
,
escape
(
ref
)
</a>
</li>"
$
(
'<li />'
)
.
append
link
id
:
(
obj
,
$el
)
->
id
:
(
obj
,
$el
)
->
$el
.
data
(
'
ref'
)
$el
.
attr
(
'data-
ref'
)
toggleLabel
:
(
obj
,
$el
)
->
toggleLabel
:
(
obj
,
$el
)
->
$el
.
text
().
trim
()
$el
.
text
().
trim
()
clicked
:
(
e
)
->
clicked
:
(
e
)
->
...
...
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