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
5d5d28e6
Commit
5d5d28e6
authored
Jan 26, 2015
by
Anton Stupak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6688 from edx/anton/edxnotes-fix-viewer
TNL-1132: Fix viewer behaviour on hover.
parents
fdb490d1
df86a331
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
lms/static/js/edxnotes/views/shim.js
+18
-0
lms/static/js/spec/edxnotes/views/shim_spec.js
+7
-0
No files found.
lms/static/js/edxnotes/views/shim.js
View file @
5d5d28e6
...
...
@@ -125,6 +125,24 @@ define(['jquery', 'underscore', 'annotator'], function ($, _, Annotator) {
Annotator
.
prototype
.
_setupViewer
);
Annotator
.
Editor
.
prototype
.
isShown
=
Annotator
.
Viewer
.
prototype
.
isShown
;
/**
* Modifies Annotator.onHighlightMouseover to avoid showing the viewer if the
* editor is opened.
**/
Annotator
.
prototype
.
onHighlightMouseover
=
_
.
wrap
(
Annotator
.
prototype
.
onHighlightMouseover
,
function
(
func
,
event
)
{
// Do nothing if the editor is opened.
if
(
this
.
editor
.
isShown
())
{
return
false
;
}
return
func
.
call
(
this
,
event
);
},
Annotator
.
prototype
.
_setupViewer
);
$
.
extend
(
true
,
Annotator
.
prototype
,
{
events
:
{
'.annotator-hl click'
:
'onHighlightClick'
,
...
...
lms/static/js/spec/edxnotes/views/shim_spec.js
View file @
5d5d28e6
...
...
@@ -49,6 +49,13 @@ define([
_
.
invoke
(
Annotator
.
_instances
,
'destroy'
);
});
it
(
'does not show the viewer if the editor is opened'
,
function
()
{
annotators
[
0
].
showEditor
({},
{});
highlights
[
0
].
mouseover
();
expect
(
$
(
'#edx-notes-wrapper-123 .annotator-editor'
)).
not
.
toHaveClass
(
'annotator-hide'
);
expect
(
$
(
'#edx-notes-wrapper-123 .annotator-viewer'
)).
toHaveClass
(
'annotator-hide'
);
});
it
(
'clicking a highlight freezes mouseover and mouseout in all highlighted text'
,
function
()
{
_
.
each
(
annotators
,
function
(
annotator
)
{
expect
(
annotator
.
isFrozen
).
toBe
(
false
);
...
...
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