BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3680612a
Commit
3680612a
authored
Jan 20, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed currentIndex being shared across dropdowns
parent
90058cf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
droplab.js
app/assets/javascripts/droplab/droplab.js
+9
-2
No files found.
app/assets/javascripts/droplab/droplab.js
View file @
3680612a
...
@@ -58,6 +58,7 @@ var CustomEvent = require('./custom_event_polyfill');
...
@@ -58,6 +58,7 @@ var CustomEvent = require('./custom_event_polyfill');
var
utils
=
require
(
'./utils'
);
var
utils
=
require
(
'./utils'
);
var
DropDown
=
function
(
list
)
{
var
DropDown
=
function
(
list
)
{
this
.
currentIndex
=
0
;
this
.
hidden
=
true
;
this
.
hidden
=
true
;
this
.
list
=
list
;
this
.
list
=
list
;
this
.
items
=
[];
this
.
items
=
[];
...
@@ -576,7 +577,7 @@ require('./window')(function(w){
...
@@ -576,7 +577,7 @@ require('./window')(function(w){
var
isUpArrow
=
false
;
var
isUpArrow
=
false
;
var
isDownArrow
=
false
;
var
isDownArrow
=
false
;
var
removeHighlight
=
function
removeHighlight
(
list
)
{
var
removeHighlight
=
function
removeHighlight
(
list
)
{
var
listItems
=
list
.
list
.
querySelectorAll
(
'li'
);
var
listItems
=
list
.
list
.
querySelectorAll
(
'li
:not(.divider)
'
);
for
(
var
i
=
0
;
i
<
listItems
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
listItems
.
length
;
i
++
)
{
listItems
[
i
].
classList
.
remove
(
'dropdown-active'
);
listItems
[
i
].
classList
.
remove
(
'dropdown-active'
);
}
}
...
@@ -589,7 +590,10 @@ require('./window')(function(w){
...
@@ -589,7 +590,10 @@ require('./window')(function(w){
if
(
!
listItems
[
currentIndex
-
1
]){
if
(
!
listItems
[
currentIndex
-
1
]){
currentIndex
=
currentIndex
-
1
;
currentIndex
=
currentIndex
-
1
;
}
}
listItems
[
currentIndex
-
1
].
classList
.
add
(
'dropdown-active'
);
if
(
listItems
[
currentIndex
-
1
])
{
listItems
[
currentIndex
-
1
].
classList
.
add
(
'dropdown-active'
);
}
}
}
};
};
...
@@ -617,6 +621,8 @@ require('./window')(function(w){
...
@@ -617,6 +621,8 @@ require('./window')(function(w){
var
keydown
=
function
keydown
(
e
){
var
keydown
=
function
keydown
(
e
){
var
typedOn
=
e
.
target
;
var
typedOn
=
e
.
target
;
var
dropdown
=
e
.
detail
.
hook
.
list
;
currentIndex
=
dropdown
.
currentIndex
;
isUpArrow
=
false
;
isUpArrow
=
false
;
isDownArrow
=
false
;
isDownArrow
=
false
;
...
@@ -649,6 +655,7 @@ require('./window')(function(w){
...
@@ -649,6 +655,7 @@ require('./window')(function(w){
if
(
isDownArrow
){
currentIndex
++
;
}
if
(
isDownArrow
){
currentIndex
++
;
}
if
(
currentIndex
<
0
){
currentIndex
=
0
;
}
if
(
currentIndex
<
0
){
currentIndex
=
0
;
}
setMenuForArrows
(
e
.
detail
.
hook
.
list
);
setMenuForArrows
(
e
.
detail
.
hook
.
list
);
dropdown
.
currentIndex
=
currentIndex
;
};
};
w
.
addEventListener
(
'mousedown.dl'
,
mousedown
);
w
.
addEventListener
(
'mousedown.dl'
,
mousedown
);
...
...
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