Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
2e6115c7
Commit
2e6115c7
authored
Mar 04, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
constrain the annotation call-out horizontally so it is always visible in the window
parent
20174fd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
common/lib/xmodule/xmodule/js/src/annotatable/display.coffee
+19
-2
No files found.
common/lib/xmodule/xmodule/js/src/annotatable/display.coffee
View file @
2e6115c7
...
@@ -73,8 +73,13 @@ class @Annotatable
...
@@ -73,8 +73,13 @@ class @Annotatable
classes
:
'ui-tooltip-annotatable'
classes
:
'ui-tooltip-annotatable'
events
:
events
:
show
:
@
onShowTip
show
:
@
onShowTip
visible
:
@
onVisibleTip
onShowTip
:
(
event
,
api
)
=>
event
.
preventDefault
()
if
@
annotationsHidden
onShowTip
:
(
event
,
api
)
=>
event
.
preventDefault
()
if
@
annotationsHidden
onVisibleTip
:
(
event
,
api
)
=>
@
constrainTipHorizontally
(
api
.
elements
.
tooltip
,
event
.
originalEvent
.
pageX
)
onClickToggleAnnotations
:
(
e
)
=>
@
toggleAnnotations
()
onClickToggleAnnotations
:
(
e
)
=>
@
toggleAnnotations
()
...
@@ -199,7 +204,19 @@ class @Annotatable
...
@@ -199,7 +204,19 @@ class @Annotatable
$
(
el
).
qtip
(
'show'
)
$
(
el
).
qtip
(
'show'
)
api
=
$
(
el
).
qtip
(
'api'
)
api
=
$
(
el
).
qtip
(
'api'
)
$
(
api
?
.
elements
.
tooltip
).
offset
(
offset
)
$
(
api
?
.
elements
.
tooltip
).
offset
(
offset
)
constrainTipHorizontally
:
(
tip
,
mouseX
)
->
win_width
=
$
(
window
).
width
()
tip_center
=
$
(
tip
).
width
()
/
2
# see position setting of tip
tip_offset
=
$
(
tip
).
offset
()
if
(
tip_center
+
mouseX
)
>
win_width
adjust_left
=
'-='
+
(
tip_center
+
mouseX
-
win_width
)
else
if
(
mouseX
-
tip_center
)
<
0
adjust_left
=
'+='
+
(
tip_center
-
mouseX
)
$
(
tip
).
animate
({
left
:
adjust_left
})
if
adjust_left
?
_once
:
(
fn
)
->
_once
:
(
fn
)
->
done
=
false
done
=
false
return
=>
return
=>
...
...
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