Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
leizi929
Sortable
提交
cddef14e
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 搜索 >>
提交
cddef14e
编写于
3月 09, 2019
作者:
O
owen-m1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improvements
上级
55bde0bc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
23 deletion
+25
-23
Sortable.js
Sortable.js
+25
-23
未找到文件。
Sortable.js
浏览文件 @
cddef14e
...
...
@@ -102,7 +102,7 @@
Safari
=
!!
(
navigator
.
userAgent
.
match
(
/safari/i
)
&&
!
navigator
.
userAgent
.
match
(
/chrome/i
)
&&
!
navigator
.
userAgent
.
match
(
/android/i
)),
IOS
=
!!
(
navigator
.
userAgent
.
match
(
/iP
(
ad|od|hone
)
/i
)),
PositionGhostAbsolutely
=
IOS
,
PositionGhostAbsolutely
=
true
||
IOS
,
CSSFloatProperty
=
Edge
||
IE11OrLess
?
'
cssFloat
'
:
'
float
'
,
...
...
@@ -1062,22 +1062,27 @@
while
(
_css
(
ghostRelativeParent
,
'
position
'
)
===
'
static
'
&&
_css
(
ghostRelativeParent
,
'
transform
'
)
===
'
none
'
&&
ghostRelativeParent
!==
document
.
body
ghostRelativeParent
!==
document
)
{
ghostRelativeParent
=
ghostRelativeParent
.
parentNode
;
}
var
ghostRelativeParentRect
=
_getRect
(
ghostRelativeParent
,
true
);
if
(
ghostRelativeParent
!==
document
)
{
var
ghostRelativeParentRect
=
_getRect
(
ghostRelativeParent
,
true
);
rect
.
top
-=
ghostRelativeParentRect
.
top
;
rect
.
left
-=
ghostRelativeParentRect
.
left
;
rect
.
top
-=
ghostRelativeParentRect
.
top
;
rect
.
left
-=
ghostRelativeParentRect
.
left
;
}
if
(
ghostRelativeParent
===
document
.
body
)
ghostRelativeParent
=
_getWindowScrollingElement
();
if
(
ghostRelativeParent
!==
document
.
body
&&
ghostRelativeParent
!==
document
.
documentElement
)
{
if
(
ghostRelativeParent
===
document
)
ghostRelativeParent
=
_getWindowScrollingElement
();
rect
.
top
+=
ghostRelativeParent
.
scrollTop
;
rect
.
left
+=
ghostRelativeParent
.
scrollLeft
;
}
else
{
ghostRelativeParent
=
_getWindowScrollingElement
();
}
ghostRelativeParentInitialScroll
=
_getRelativeScrollOffset
(
ghostRelativeParent
);
rect
.
top
+=
ghostRelativeParent
.
scrollTop
;
rect
.
left
+=
ghostRelativeParent
.
scrollLeft
;
}
...
...
@@ -2400,22 +2405,19 @@
* @return {Array} Offsets in the format of [left, top]
*/
function
_getRelativeScrollOffset
(
el
)
{
var
offsetLeft
=
0
,
offsetTop
=
0
;
while
(
el
&&
el
.
parentNode
)
{
var
matrix
=
_matrix
(
el
),
scaleX
=
matrix
.
a
,
scaleY
=
matrix
.
d
;
var
offsetLeft
=
0
,
offsetTop
=
0
,
winScroller
=
_getWindowScrollingElement
();
offsetLeft
+=
el
.
scrollLeft
*
scaleX
;
offsetTop
+=
el
.
scrollTop
*
scaleY
;
el
=
el
.
parentNode
;
if
(
el
)
{
do
{
var
matrix
=
_matrix
(
el
),
scaleX
=
matrix
.
a
,
scaleY
=
matrix
.
d
;
if
(
el
===
_getWindowScrollingElement
())
{
offsetLeft
+=
_getWindowScrollingElement
().
scrollLeft
;
offsetTop
+=
_getWindowScrollingElement
().
scrollTop
;
break
;
}
offsetLeft
+=
el
.
scrollLeft
*
scaleX
;
offsetTop
+=
el
.
scrollTop
*
scaleY
;
}
while
(
el
!==
winScroller
&&
(
el
=
el
.
parentNode
));
}
return
[
offsetLeft
,
offsetTop
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录