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
c0a9ece1
Commit
c0a9ece1
authored
Jan 20, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DropLab in IE11 v1
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/26785
parent
5c6a7aae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
21 deletions
+48
-21
app/assets/javascripts/droplab/droplab.js
app/assets/javascripts/droplab/droplab.js
+29
-20
app/assets/javascripts/extensions/custom_event.js.es6
app/assets/javascripts/extensions/custom_event.js.es6
+11
-0
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
...vascripts/filtered_search/filtered_search_dropdown.js.es6
+4
-1
changelogs/unreleased/26785-fix-droplab-in-ie-11-v1.yml
changelogs/unreleased/26785-fix-droplab-in-ie-11-v1.yml
+4
-0
No files found.
app/assets/javascripts/droplab/droplab.js
View file @
c0a9ece1
...
@@ -62,6 +62,7 @@ var DropDown = function(list) {
...
@@ -62,6 +62,7 @@ var DropDown = function(list) {
this
.
list
=
list
;
this
.
list
=
list
;
this
.
items
=
[];
this
.
items
=
[];
this
.
getItems
();
this
.
getItems
();
this
.
initTemplateString
();
this
.
addEvents
();
this
.
addEvents
();
this
.
initialState
=
list
.
innerHTML
;
this
.
initialState
=
list
.
innerHTML
;
};
};
...
@@ -72,6 +73,17 @@ Object.assign(DropDown.prototype, {
...
@@ -72,6 +73,17 @@ Object.assign(DropDown.prototype, {
return
this
.
items
;
return
this
.
items
;
},
},
initTemplateString
:
function
()
{
var
items
=
this
.
items
||
this
.
getItems
();
var
templateString
=
''
;
if
(
items
.
length
>
0
)
{
templateString
=
items
[
items
.
length
-
1
].
outerHTML
;
}
this
.
templateString
=
templateString
;
return
this
.
templateString
;
},
clickEvent
:
function
(
e
)
{
clickEvent
:
function
(
e
)
{
// climb up the tree to find the LI
// climb up the tree to find the LI
var
selected
=
utils
.
closest
(
e
.
target
,
'
LI
'
);
var
selected
=
utils
.
closest
(
e
.
target
,
'
LI
'
);
...
@@ -111,30 +123,21 @@ Object.assign(DropDown.prototype, {
...
@@ -111,30 +123,21 @@ Object.assign(DropDown.prototype, {
addData
:
function
(
data
)
{
addData
:
function
(
data
)
{
this
.
data
=
(
this
.
data
||
[]).
concat
(
data
);
this
.
data
=
(
this
.
data
||
[]).
concat
(
data
);
this
.
render
(
data
);
this
.
render
(
this
.
data
);
},
},
// call render manually on data;
// call render manually on data;
render
:
function
(
data
){
render
:
function
(
data
){
// debugger
// debugger
// empty the list first
// empty the list first
var
sampleItem
;
var
templateString
=
this
.
templateString
;
var
newChildren
=
[];
var
newChildren
=
[];
var
toAppend
;
var
toAppend
;
for
(
var
i
=
0
;
i
<
this
.
items
.
length
;
i
++
)
{
newChildren
=
(
data
||
[]).
map
(
function
(
dat
){
var
item
=
this
.
items
[
i
];
var
html
=
utils
.
t
(
templateString
,
dat
);
sampleItem
=
item
;
if
(
item
.
parentNode
&&
item
.
parentNode
.
dataset
.
hasOwnProperty
(
'
dynamic
'
))
{
item
.
parentNode
.
removeChild
(
item
);
}
}
newChildren
=
this
.
data
.
map
(
function
(
dat
){
var
html
=
utils
.
t
(
sampleItem
.
outerHTML
,
dat
);
var
template
=
document
.
createElement
(
'
div
'
);
var
template
=
document
.
createElement
(
'
div
'
);
template
.
innerHTML
=
html
;
template
.
innerHTML
=
html
;
// console.log(template.content)
// Help set the image src template
// Help set the image src template
var
imageTags
=
template
.
querySelectorAll
(
'
img[data-src]
'
);
var
imageTags
=
template
.
querySelectorAll
(
'
img[data-src]
'
);
...
@@ -173,10 +176,7 @@ Object.assign(DropDown.prototype, {
...
@@ -173,10 +176,7 @@ Object.assign(DropDown.prototype, {
},
},
destroy
:
function
()
{
destroy
:
function
()
{
if
(
!
this
.
hidden
)
{
this
.
hide
();
this
.
hide
();
}
this
.
list
.
removeEventListener
(
'
click
'
,
this
.
clickWrapper
);
this
.
list
.
removeEventListener
(
'
click
'
,
this
.
clickWrapper
);
}
}
});
});
...
@@ -462,6 +462,8 @@ Object.assign(HookInput.prototype, {
...
@@ -462,6 +462,8 @@ Object.assign(HookInput.prototype, {
var
self
=
this
;
var
self
=
this
;
this
.
mousedown
=
function
mousedown
(
e
)
{
this
.
mousedown
=
function
mousedown
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
var
mouseEvent
=
new
CustomEvent
(
'
mousedown.dl
'
,
{
var
mouseEvent
=
new
CustomEvent
(
'
mousedown.dl
'
,
{
detail
:
{
detail
:
{
hook
:
self
,
hook
:
self
,
...
@@ -474,6 +476,8 @@ Object.assign(HookInput.prototype, {
...
@@ -474,6 +476,8 @@ Object.assign(HookInput.prototype, {
}
}
this
.
input
=
function
input
(
e
)
{
this
.
input
=
function
input
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
var
inputEvent
=
new
CustomEvent
(
'
input.dl
'
,
{
var
inputEvent
=
new
CustomEvent
(
'
input.dl
'
,
{
detail
:
{
detail
:
{
hook
:
self
,
hook
:
self
,
...
@@ -487,10 +491,14 @@ Object.assign(HookInput.prototype, {
...
@@ -487,10 +491,14 @@ Object.assign(HookInput.prototype, {
}
}
this
.
keyup
=
function
keyup
(
e
)
{
this
.
keyup
=
function
keyup
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
keyEvent
(
e
,
'
keyup.dl
'
);
keyEvent
(
e
,
'
keyup.dl
'
);
}
}
this
.
keydown
=
function
keydown
(
e
)
{
this
.
keydown
=
function
keydown
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
keyEvent
(
e
,
'
keydown.dl
'
);
keyEvent
(
e
,
'
keydown.dl
'
);
}
}
...
@@ -520,7 +528,8 @@ Object.assign(HookInput.prototype, {
...
@@ -520,7 +528,8 @@ Object.assign(HookInput.prototype, {
this
.
trigger
.
addEventListener
(
'
keydown
'
,
this
.
keydown
);
this
.
trigger
.
addEventListener
(
'
keydown
'
,
this
.
keydown
);
},
},
removeEvents
:
function
(){
removeEvents
:
function
()
{
this
.
hasRemovedEvents
=
true
;
this
.
trigger
.
removeEventListener
(
'
mousedown
'
,
this
.
mousedown
);
this
.
trigger
.
removeEventListener
(
'
mousedown
'
,
this
.
mousedown
);
this
.
trigger
.
removeEventListener
(
'
input
'
,
this
.
input
);
this
.
trigger
.
removeEventListener
(
'
input
'
,
this
.
input
);
this
.
trigger
.
removeEventListener
(
'
keyup
'
,
this
.
keyup
);
this
.
trigger
.
removeEventListener
(
'
keyup
'
,
this
.
keyup
);
...
@@ -668,14 +677,14 @@ var camelize = function(str) {
...
@@ -668,14 +677,14 @@ var camelize = function(str) {
};
};
var
closest
=
function
(
thisTag
,
stopTag
)
{
var
closest
=
function
(
thisTag
,
stopTag
)
{
while
(
thisTag
.
tagName
!==
stopTag
&&
thisTag
.
tagName
!==
'
HTML
'
){
while
(
thisTag
&&
thisTag
.
tagName
!==
stopTag
&&
thisTag
.
tagName
!==
'
HTML
'
){
thisTag
=
thisTag
.
parentNode
;
thisTag
=
thisTag
.
parentNode
;
}
}
return
thisTag
;
return
thisTag
;
};
};
var
isDropDownParts
=
function
(
target
)
{
var
isDropDownParts
=
function
(
target
)
{
if
(
target
.
tagName
===
'
HTML
'
)
{
return
false
;
}
if
(
!
target
||
target
.
tagName
===
'
HTML
'
)
{
return
false
;
}
return
(
return
(
target
.
hasAttribute
(
DATA_TRIGGER
)
||
target
.
hasAttribute
(
DATA_TRIGGER
)
||
target
.
hasAttribute
(
DATA_DROPDOWN
)
target
.
hasAttribute
(
DATA_DROPDOWN
)
...
...
app/assets/javascripts/extensions/custom_event.js.es6
0 → 100644
View file @
c0a9ece1
/* global CustomEvent */
// Custom event support for IE
CustomEvent = function (event, parameters) {
const params = parameters || { bubbles: false, cancelable: false, detail: undefined };
const evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
CustomEvent.prototype = window.Event.prototype;
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
View file @
c0a9ece1
...
@@ -78,7 +78,10 @@
...
@@ -78,7 +78,10 @@
dispatchInputEvent() {
dispatchInputEvent() {
// Propogate input change to FilteredSearchDropdownManager
// Propogate input change to FilteredSearchDropdownManager
// so that it can determine which dropdowns to open
// so that it can determine which dropdowns to open
this.input.dispatchEvent(new Event('input'));
this.input.dispatchEvent(new CustomEvent('input', {
bubbles: true,
cancelable: true,
}));
}
}
hideDropdown() {
hideDropdown() {
...
...
changelogs/unreleased/26785-fix-droplab-in-ie-11-v1.yml
0 → 100644
View file @
c0a9ece1
---
title
:
Add some basic fixes for IE11/Edge
merge_request
:
author
:
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