Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
f19724de
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f19724de
编写于
1月 21, 2017
作者:
J
Jacob Schatz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Merge branch '26785-fix-droplab-in-ie-11-v1' into 'master'"
This reverts merge request !8675
上级
611917ec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
48 deletion
+21
-48
app/assets/javascripts/droplab/droplab.js
app/assets/javascripts/droplab/droplab.js
+20
-29
app/assets/javascripts/extensions/custom_event.js.es6
app/assets/javascripts/extensions/custom_event.js.es6
+0
-11
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
...vascripts/filtered_search/filtered_search_dropdown.js.es6
+1
-4
changelogs/unreleased/26785-fix-droplab-in-ie-11-v1.yml
changelogs/unreleased/26785-fix-droplab-in-ie-11-v1.yml
+0
-4
未找到文件。
app/assets/javascripts/droplab/droplab.js
浏览文件 @
f19724de
...
...
@@ -62,7 +62,6 @@ var DropDown = function(list) {
this
.
list
=
list
;
this
.
items
=
[];
this
.
getItems
();
this
.
initTemplateString
();
this
.
addEvents
();
this
.
initialState
=
list
.
innerHTML
;
};
...
...
@@ -73,17 +72,6 @@ Object.assign(DropDown.prototype, {
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
)
{
// climb up the tree to find the LI
var
selected
=
utils
.
closest
(
e
.
target
,
'
LI
'
);
...
...
@@ -123,21 +111,30 @@ Object.assign(DropDown.prototype, {
addData
:
function
(
data
)
{
this
.
data
=
(
this
.
data
||
[]).
concat
(
data
);
this
.
render
(
this
.
data
);
this
.
render
(
data
);
},
// call render manually on data;
render
:
function
(
data
){
// debugger
// empty the list first
var
templateString
=
this
.
templateString
;
var
sampleItem
;
var
newChildren
=
[];
var
toAppend
;
newChildren
=
(
data
||
[]).
map
(
function
(
dat
){
var
html
=
utils
.
t
(
templateString
,
dat
);
for
(
var
i
=
0
;
i
<
this
.
items
.
length
;
i
++
)
{
var
item
=
this
.
items
[
i
];
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
'
);
template
.
innerHTML
=
html
;
// console.log(template.content)
// Help set the image src template
var
imageTags
=
template
.
querySelectorAll
(
'
img[data-src]
'
);
...
...
@@ -176,7 +173,10 @@ Object.assign(DropDown.prototype, {
},
destroy
:
function
()
{
this
.
hide
();
if
(
!
this
.
hidden
)
{
this
.
hide
();
}
this
.
list
.
removeEventListener
(
'
click
'
,
this
.
clickWrapper
);
}
});
...
...
@@ -462,8 +462,6 @@ Object.assign(HookInput.prototype, {
var
self
=
this
;
this
.
mousedown
=
function
mousedown
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
var
mouseEvent
=
new
CustomEvent
(
'
mousedown.dl
'
,
{
detail
:
{
hook
:
self
,
...
...
@@ -476,8 +474,6 @@ Object.assign(HookInput.prototype, {
}
this
.
input
=
function
input
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
var
inputEvent
=
new
CustomEvent
(
'
input.dl
'
,
{
detail
:
{
hook
:
self
,
...
...
@@ -491,14 +487,10 @@ Object.assign(HookInput.prototype, {
}
this
.
keyup
=
function
keyup
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
keyEvent
(
e
,
'
keyup.dl
'
);
}
this
.
keydown
=
function
keydown
(
e
)
{
if
(
self
.
hasRemovedEvents
)
return
;
keyEvent
(
e
,
'
keydown.dl
'
);
}
...
...
@@ -528,8 +520,7 @@ Object.assign(HookInput.prototype, {
this
.
trigger
.
addEventListener
(
'
keydown
'
,
this
.
keydown
);
},
removeEvents
:
function
()
{
this
.
hasRemovedEvents
=
true
;
removeEvents
:
function
(){
this
.
trigger
.
removeEventListener
(
'
mousedown
'
,
this
.
mousedown
);
this
.
trigger
.
removeEventListener
(
'
input
'
,
this
.
input
);
this
.
trigger
.
removeEventListener
(
'
keyup
'
,
this
.
keyup
);
...
...
@@ -677,14 +668,14 @@ var camelize = function(str) {
};
var
closest
=
function
(
thisTag
,
stopTag
)
{
while
(
thisTag
&&
thisTag
.
tagName
!==
stopTag
&&
thisTag
.
tagName
!==
'
HTML
'
){
while
(
thisTag
.
tagName
!==
stopTag
&&
thisTag
.
tagName
!==
'
HTML
'
){
thisTag
=
thisTag
.
parentNode
;
}
return
thisTag
;
};
var
isDropDownParts
=
function
(
target
)
{
if
(
!
target
||
target
.
tagName
===
'
HTML
'
)
{
return
false
;
}
if
(
target
.
tagName
===
'
HTML
'
)
{
return
false
;
}
return
(
target
.
hasAttribute
(
DATA_TRIGGER
)
||
target
.
hasAttribute
(
DATA_DROPDOWN
)
...
...
app/assets/javascripts/extensions/custom_event.js.es6
已删除
100644 → 0
浏览文件 @
611917ec
/* 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
浏览文件 @
f19724de
...
...
@@ -78,10 +78,7 @@
dispatchInputEvent() {
// Propogate input change to FilteredSearchDropdownManager
// so that it can determine which dropdowns to open
this.input.dispatchEvent(new CustomEvent('input', {
bubbles: true,
cancelable: true,
}));
this.input.dispatchEvent(new Event('input'));
}
hideDropdown() {
...
...
changelogs/unreleased/26785-fix-droplab-in-ie-11-v1.yml
已删除
100644 → 0
浏览文件 @
611917ec
---
title
:
Add some basic fixes for IE11/Edge
merge_request
:
author
:
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录