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
0ca71319
Commit
0ca71319
authored
Feb 01, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clicking on annotation span should scroll to the discussion widget.
parent
8f005a5a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
10 deletions
+30
-10
common/lib/xmodule/xmodule/annotatable_module.py
+1
-0
common/lib/xmodule/xmodule/css/annotatable/display.scss
+1
-1
common/lib/xmodule/xmodule/js/src/annotatable/display.coffee
+27
-7
lms/templates/annotatable.html
+1
-2
No files found.
common/lib/xmodule/xmodule/annotatable_module.py
View file @
0ca71319
...
...
@@ -26,6 +26,7 @@ class AnnotatableModule(XModule):
}
js_module_name
=
"Annotatable"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/annotatable/display.scss'
)]}
icon_class
=
'annotatable'
def
_is_span
(
self
,
element
):
""" Returns true if the element is a valid annotation span, false otherwise. """
...
...
common/lib/xmodule/xmodule/css/annotatable/display.scss
View file @
0ca71319
...
...
@@ -14,9 +14,9 @@
}
}
span
.annotatable
{
color
:
$blue
;
cursor
:
pointer
;
.annotatable-icon
{
margin
:
auto
2px
auto
4px
;
}
...
...
common/lib/xmodule/xmodule/js/src/annotatable/display.coffee
View file @
0ca71319
class
@
Annotatable
@
_debug
:
true
constructor
:
(
el
)
->
console
.
log
"loaded Annotatable"
$
(
el
).
find
(
".annotatable"
).
on
"click"
,
(
e
)
->
data
=
$
(
".annotatable-wrapper"
,
el
).
data
(
"spans"
)
span_id
=
e
.
target
.
getAttribute
(
"data-span-id"
)
msg
=
"annotatable span clicked. discuss span ["
+
span_id
+
"] in discussion ["
+
data
[
span_id
]
+
"]"
console
.
log
data
window
.
alert
msg
console
.
log
'loaded Annotatable'
if
@
_debug
@
el
=
el
@
spandata
=
$
(
'.annotatable-wrapper'
,
@
el
).
data
"spans"
@
initSpans
()
initSpans
:
()
->
selector
=
'span.annotatable[data-span-id]'
$
(
@
el
).
find
(
selector
).
on
'click'
,
(
e
)
=>
@
onClickSpan
.
call
this
,
e
onClickSpan
:
(
e
)
->
span_id
=
e
.
target
.
getAttribute
(
'data-span-id'
)
discussion_id
=
@
spandata
[
span_id
]
selector
=
'.annotatable-discussion[data-discussion-id="'
+
discussion_id
+
'"]'
;
$discussion
=
$
(
selector
,
@
el
)
padding
=
20
top
=
$discussion
.
offset
().
top
-
padding
highlighted
=
false
complete
=
()
->
if
!
highlighted
$discussion
.
effect
(
'highlight'
,
{},
1000
)
highlighted
=
true
$
(
'html, body'
).
animate
({
scrollTop
:
top
,
},
1000
,
'swing'
,
complete
)
lms/templates/annotatable.html
View file @
0ca71319
...
...
@@ -20,4 +20,4 @@ $(function() {
});
</script>
</div>
\ No newline at end of file
</div>
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