Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
leizi929
Sortable
提交
1b6d956f
S
Sortable
项目概览
leizi929
/
Sortable
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Sortable
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1b6d956f
编写于
9月 28, 2017
作者:
R
RubaXa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* fixed start/stop
上级
1f7036c6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
22 deletion
+28
-22
Sortable.js
Sortable.js
+28
-22
未找到文件。
Sortable.js
浏览文件 @
1b6d956f
...
...
@@ -628,25 +628,23 @@
_onDragStart
:
function
(
/**Event*/
evt
,
/**boolean*/
useFallback
)
{
var
_this
=
this
;
var
dataTransfer
=
evt
.
dataTransfer
;
var
options
=
this
.
options
;
var
options
=
_
this
.
options
;
this
.
_offUpEvents
();
_
this
.
_offUpEvents
();
if
(
activeGroup
.
checkPull
(
this
,
this
,
dragEl
,
evt
))
{
if
(
activeGroup
.
checkPull
(
_this
,
_
this
,
dragEl
,
evt
))
{
cloneEl
=
_clone
(
dragEl
);
cloneEl
.
draggable
=
false
;
cloneEl
.
style
[
'
will-change
'
]
=
''
;
_css
(
cloneEl
,
'
display
'
,
'
none
'
);
_toggleClass
(
cloneEl
,
this
.
options
.
chosenClass
,
false
);
_toggleClass
(
cloneEl
,
_
this
.
options
.
chosenClass
,
false
);
// #1143: IFrame support workaround
_nextTick
(
function
()
{
if
(
dragEl
&&
(
dragEl
.
parentNode
===
rootEl
))
{
rootEl
.
insertBefore
(
cloneEl
,
dragEl
);
_dispatchEvent
(
_this
,
rootEl
,
'
clone
'
,
dragEl
);
}
_this
.
_cloneId
=
_nextTick
(
function
()
{
rootEl
.
insertBefore
(
cloneEl
,
dragEl
);
_dispatchEvent
(
_this
,
rootEl
,
'
clone
'
,
dragEl
);
});
}
...
...
@@ -655,27 +653,27 @@
if
(
useFallback
)
{
if
(
useFallback
===
'
touch
'
)
{
// Bind touch events
_on
(
document
,
'
touchmove
'
,
this
.
_onTouchMove
);
_on
(
document
,
'
touchend
'
,
this
.
_onDrop
);
_on
(
document
,
'
touchcancel
'
,
this
.
_onDrop
);
_on
(
document
,
'
pointermove
'
,
this
.
_onTouchMove
);
_on
(
document
,
'
pointerup
'
,
this
.
_onDrop
);
_on
(
document
,
'
touchmove
'
,
_
this
.
_onTouchMove
);
_on
(
document
,
'
touchend
'
,
_
this
.
_onDrop
);
_on
(
document
,
'
touchcancel
'
,
_
this
.
_onDrop
);
_on
(
document
,
'
pointermove
'
,
_
this
.
_onTouchMove
);
_on
(
document
,
'
pointerup
'
,
_
this
.
_onDrop
);
}
else
{
// Old brwoser
_on
(
document
,
'
mousemove
'
,
this
.
_onTouchMove
);
_on
(
document
,
'
mouseup
'
,
this
.
_onDrop
);
_on
(
document
,
'
mousemove
'
,
_
this
.
_onTouchMove
);
_on
(
document
,
'
mouseup
'
,
_
this
.
_onDrop
);
}
this
.
_loopId
=
setInterval
(
this
.
_emulateDragOver
,
50
);
_this
.
_loopId
=
setInterval
(
_
this
.
_emulateDragOver
,
50
);
}
else
{
if
(
dataTransfer
)
{
dataTransfer
.
effectAllowed
=
'
move
'
;
options
.
setData
&&
options
.
setData
.
call
(
this
,
dataTransfer
,
dragEl
);
options
.
setData
&&
options
.
setData
.
call
(
_
this
,
dataTransfer
,
dragEl
);
}
_on
(
document
,
'
drop
'
,
this
);
_
nextTick
(
this
.
_dragStarted
);
_on
(
document
,
'
drop
'
,
_
this
);
_
this
.
_dragStartId
=
_nextTick
(
_
this
.
_dragStarted
);
}
},
...
...
@@ -890,6 +888,9 @@
clearInterval
(
autoScroll
.
pid
);
clearTimeout
(
this
.
_dragStartTimer
);
_cancelNextTick
(
this
.
_cloneId
);
_cancelNextTick
(
this
.
_dragStartId
);
// Unbind events
_off
(
document
,
'
mousemove
'
,
this
.
_onTouchMove
);
...
...
@@ -1454,7 +1455,11 @@
}
function
_nextTick
(
fn
)
{
setTimeout
(
fn
,
0
);
return
setTimeout
(
fn
,
0
);
}
function
_cancelNextTick
(
id
)
{
return
clearTimeout
(
id
);
}
// Fixed #973:
...
...
@@ -1490,7 +1495,8 @@
toggleClass
:
_toggleClass
,
clone
:
_clone
,
index
:
_index
,
nextTick
:
_nextTick
nextTick
:
_nextTick
,
cancelNextTick
:
_cancelNextTick
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录