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
Boxiang Sun
gitlab-ce
Commits
2c6471dd
Commit
2c6471dd
authored
Jan 20, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the event listener target from window to document in droplab
parent
4af1f186
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
app/assets/javascripts/droplab/droplab.js
app/assets/javascripts/droplab/droplab.js
+7
-7
No files found.
app/assets/javascripts/droplab/droplab.js
View file @
2c6471dd
...
@@ -126,7 +126,7 @@ Object.assign(DropDown.prototype, {
...
@@ -126,7 +126,7 @@ Object.assign(DropDown.prototype, {
var
item
=
this
.
items
[
i
];
var
item
=
this
.
items
[
i
];
sampleItem
=
item
;
sampleItem
=
item
;
if
(
item
.
parentNode
&&
item
.
parentNode
.
dataset
.
hasOwnProperty
(
'
dynamic
'
))
{
if
(
item
.
parentNode
&&
item
.
parentNode
.
dataset
.
hasOwnProperty
(
'
dynamic
'
))
{
item
.
parentNode
.
removeChild
(
item
);
item
.
parentNode
.
removeChild
(
item
);
}
}
}
}
...
@@ -156,7 +156,7 @@ Object.assign(DropDown.prototype, {
...
@@ -156,7 +156,7 @@ Object.assign(DropDown.prototype, {
if
(
toAppend
)
{
if
(
toAppend
)
{
toAppend
.
innerHTML
=
newChildren
.
join
(
''
);
toAppend
.
innerHTML
=
newChildren
.
join
(
''
);
}
else
{
}
else
{
this
.
list
.
innerHTML
=
newChildren
.
join
(
''
);
this
.
list
.
innerHTML
=
newChildren
.
join
(
''
);
}
}
},
},
...
@@ -278,7 +278,7 @@ require('./window')(function(w){
...
@@ -278,7 +278,7 @@ require('./window')(function(w){
self
.
hooks
[
i
].
list
.
hide
();
self
.
hooks
[
i
].
list
.
hide
();
}
}
}.
bind
(
this
);
}.
bind
(
this
);
w
.
addEventListener
(
'
click
'
,
this
.
windowClickedWrapper
);
document
.
addEventListener
(
'
click
'
,
this
.
windowClickedWrapper
);
},
},
removeEvents
:
function
(){
removeEvents
:
function
(){
...
@@ -307,7 +307,7 @@ require('./window')(function(w){
...
@@ -307,7 +307,7 @@ require('./window')(function(w){
if
(
!
list
){
if
(
!
list
){
list
=
document
.
querySelector
(
hook
.
dataset
[
utils
.
toDataCamelCase
(
DATA_TRIGGER
)]);
list
=
document
.
querySelector
(
hook
.
dataset
[
utils
.
toDataCamelCase
(
DATA_TRIGGER
)]);
}
}
if
(
hook
)
{
if
(
hook
)
{
if
(
hook
.
tagName
===
'
A
'
||
hook
.
tagName
===
'
BUTTON
'
)
{
if
(
hook
.
tagName
===
'
A
'
||
hook
.
tagName
===
'
BUTTON
'
)
{
this
.
hooks
.
push
(
new
HookButton
(
hook
,
list
,
plugins
,
config
));
this
.
hooks
.
push
(
new
HookButton
(
hook
,
list
,
plugins
,
config
));
...
@@ -578,7 +578,7 @@ require('./window')(function(w){
...
@@ -578,7 +578,7 @@ require('./window')(function(w){
var
listItems
=
removeHighlight
(
list
);
var
listItems
=
removeHighlight
(
list
);
if
(
currentIndex
>
0
){
if
(
currentIndex
>
0
){
if
(
!
listItems
[
currentIndex
-
1
]){
if
(
!
listItems
[
currentIndex
-
1
]){
currentIndex
=
currentIndex
-
1
;
currentIndex
=
currentIndex
-
1
;
}
}
listItems
[
currentIndex
-
1
].
classList
.
add
(
'
dropdown-active
'
);
listItems
[
currentIndex
-
1
].
classList
.
add
(
'
dropdown-active
'
);
}
}
...
@@ -630,7 +630,7 @@ require('./window')(function(w){
...
@@ -630,7 +630,7 @@ require('./window')(function(w){
return
;
return
;
}
}
if
(
currentKey
===
'
ArrowUp
'
)
{
if
(
currentKey
===
'
ArrowUp
'
)
{
isUpArrow
=
true
;
isUpArrow
=
true
;
}
}
if
(
currentKey
===
'
ArrowDown
'
)
{
if
(
currentKey
===
'
ArrowDown
'
)
{
isDownArrow
=
true
;
isDownArrow
=
true
;
...
@@ -677,7 +677,7 @@ var closest = function(thisTag, stopTag) {
...
@@ -677,7 +677,7 @@ var closest = function(thisTag, stopTag) {
var
isDropDownParts
=
function
(
target
)
{
var
isDropDownParts
=
function
(
target
)
{
if
(
target
.
tagName
===
'
HTML
'
)
{
return
false
;
}
if
(
target
.
tagName
===
'
HTML
'
)
{
return
false
;
}
return
(
return
(
target
.
hasAttribute
(
DATA_TRIGGER
)
||
target
.
hasAttribute
(
DATA_TRIGGER
)
||
target
.
hasAttribute
(
DATA_DROPDOWN
)
target
.
hasAttribute
(
DATA_DROPDOWN
)
);
);
};
};
...
...
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