Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
9f19f92e
Commit
9f19f92e
authored
Mar 18, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'gergely-ujvari/305-drag-resize-problems' into develop
parents
e23c02ca
12ad3793
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
host.coffee
h/js/inject/host.coffee
+8
-0
services.coffee
h/js/services.coffee
+9
-4
No files found.
h/js/inject/host.coffee
View file @
9f19f92e
...
...
@@ -14,6 +14,8 @@ class Annotator.Host extends Annotator
delta
:
0
last
:
null
tick
:
false
#Do we enable dragging
canDrag
:
false
constructor
:
(
element
,
options
)
->
super
...
...
@@ -141,6 +143,10 @@ class Annotator.Host extends Annotator
$
(
'html, body'
).
stop
().
animate
{
scrollTop
:
y
},
600
)
.
bind
(
'setDrag'
,
(
ctx
,
drag
)
=>
@
canDrag
=
drag
)
scanDocument
:
(
reason
=
"something happened"
)
=>
try
console
.
log
"Analyzing host frame, because "
+
reason
+
"..."
...
...
@@ -190,6 +196,7 @@ class Annotator.Host extends Annotator
@
panel
?
.
notify
method
:
'publish'
,
params
:
'hostUpdated'
document
.
addEventListener
'touchmove'
,
update
document
.
addEventListener
'touchstart'
,
=>
unless
@
canDrag
then
return
touch
=
true
@
frame
?
.
css
display
:
'none'
...
...
@@ -202,6 +209,7 @@ class Annotator.Host extends Annotator
@
drag
.
tick
=
true
window
.
requestAnimationFrame
this
.
_dragRefresh
document
.
addEventListener
'dragleave'
,
(
event
)
=>
unless
@
canDrag
then
return
if
@
drag
.
last
?
@
drag
.
delta
+=
event
.
screenX
-
@
drag
.
last
@
drag
.
last
=
event
.
screenX
...
...
h/js/services.coffee
View file @
9f19f92e
...
...
@@ -15,6 +15,7 @@ class Hypothesis extends Annotator
# Internal state
visible
:
false
# * Whether the sidebar is visible
dragging
:
false
# * To enable dragging only when we really want to
# Here as a noop just to make the Permissions plugin happy
# XXX: Change me when Annotator stops assuming things about viewers
...
...
@@ -191,13 +192,17 @@ class Hypothesis extends Annotator
handle
.
addEventListener
'dragstart'
,
(
event
)
=>
event
.
dataTransfer
.
setData
'text/plain'
,
''
event
.
dataTransfer
.
setDragImage
el
,
0
,
0
@
provider
.
dragFrame
event
.
screenX
@
dragging
=
true
@
provider
.
notify
method
:
'setDrag'
,
params
:
true
@
provider
.
notify
method
:
'dragFrame'
,
params
:
event
.
screenX
handle
.
addEventListener
'dragend'
,
(
event
)
=>
@
provider
.
dragFrame
event
.
screenX
@
dragging
=
false
@
provider
.
notify
method
:
'setDrag'
,
params
:
false
@
provider
.
notify
method
:
'dragFrame'
,
params
:
event
.
screenX
@
element
[
0
].
addEventListener
'dragover'
,
(
event
)
=>
@
provider
.
dragFrame
event
.
screenX
if
@
dragging
then
@
provider
.
notify
method
:
'dragFrame'
,
params
:
event
.
screenX
@
element
[
0
].
addEventListener
'dragleave'
,
(
event
)
=>
@
provider
.
dragFrame
event
.
screenX
if
@
dragging
then
@
provider
.
notify
method
:
'dragFrame'
,
params
:
event
.
screenX
this
...
...
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