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
7124e510
Commit
7124e510
authored
Aug 11, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated simulateDrag JS
parent
17c576c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
app/assets/javascripts/boards/test_utils/simulate_drag.js
app/assets/javascripts/boards/test_utils/simulate_drag.js
+5
-10
No files found.
app/assets/javascripts/boards/test_utils/simulate_drag.js
View file @
7124e510
...
...
@@ -85,14 +85,10 @@
simulateEvent
(
fromEl
,
'
mousedown
'
,
{
button
:
0
});
options
.
ontap
&&
options
.
ontap
();
requestAnimationFrame
(
function
()
{
options
.
ondragstart
&&
options
.
ondragstart
();
});
requestAnimationFrame
(
function
loop
()
{
var
dragInterval
=
setInterval
(
function
loop
()
{
var
progress
=
(
new
Date
().
getTime
()
-
startTime
)
/
duration
;
var
x
=
(
fromRect
.
cx
+
(
toRect
.
cx
-
fromRect
.
cx
)
*
progress
)
-
scrollable
.
scrollLeft
;
var
y
=
fromRect
.
cy
+
(
toRect
.
cy
-
fromRect
.
cy
)
*
progress
;
var
y
=
(
fromRect
.
cy
+
(
toRect
.
cy
-
fromRect
.
cy
)
*
progress
)
-
scrollable
.
scrollTop
;
var
overEl
=
fromEl
.
ownerDocument
.
elementFromPoint
(
x
,
y
);
simulateEvent
(
overEl
,
'
mousemove
'
,
{
...
...
@@ -100,13 +96,12 @@
clientY
:
y
});
if
(
progress
<
1
)
{
requestAnimationFrame
(
loop
);
}
else
{
if
(
progress
>=
1
)
{
options
.
ondragend
&&
options
.
ondragend
();
simulateEvent
(
toEl
,
'
mouseup
'
);
clearInterval
(
dragInterval
);
}
});
}
,
100
);
return
{
target
:
fromEl
,
...
...
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