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
5ccf717d
Commit
5ccf717d
authored
Sep 16, 2013
by
jmclaus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved css from js file to relevant scss file.
parent
c541fb7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
17 deletions
+24
-17
common/lib/xmodule/xmodule/css/video/display.scss
+10
-0
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
+14
-17
No files found.
common/lib/xmodule/xmodule/css/video/display.scss
View file @
5ccf717d
...
...
@@ -531,6 +531,16 @@ div.video {
font-weight
:
700
;
}
&
.unfocused
{
outline-width
:
0px
;
outline-style
:
none
;
}
&
.focused
{
outline-width
:
1px
;
outline-style
:
dotted
;
}
&
:hover
{
color
:
$blue
;
}
...
...
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
View file @
5ccf717d
...
...
@@ -362,17 +362,21 @@ function () {
// On mouseLeave, show the outline of a caption that has been tabbed to.
function
captionMouseEnterLeave
(
event
)
{
var
caption
=
$
(
event
.
target
),
outlineWidth
=
(
event
.
type
===
'mouseleave'
)
?
1
:
0
,
captionIndex
=
parseInt
(
caption
.
attr
(
'data-index'
),
10
);
if
(
captionIndex
===
this
.
videoCaption
.
currentCaptionIndex
)
{
caption
.
css
(
'outlineWidth'
,
outlineWidth
+
'px'
);
if
(
event
.
type
===
'mouseenter'
)
{
caption
.
removeClass
(
'focused'
).
addClass
(
'unfocused'
);
}
else
{
// mouseleave
caption
.
removeClass
(
'unfocused'
).
addClass
(
'focused'
);
}
}
}
function
captionMouseDown
(
event
)
{
var
caption
=
$
(
event
.
target
);
this
.
videoCaption
.
isMouseFocus
=
true
;
caption
.
css
(
'outlineWidth'
,
'0px
'
);
caption
.
removeClass
(
'focused'
).
addClass
(
'unfocused
'
);
this
.
videoCaption
.
autoScrolling
=
true
;
}
...
...
@@ -383,23 +387,19 @@ function () {
function
captionFocus
(
event
)
{
var
caption
=
$
(
event
.
target
),
captionIndex
=
parseInt
(
caption
.
attr
(
'data-index'
),
10
);
// If the focus comes from a mouse click, hide the outline and turn on
// automatic scrolling.
// If the focus comes from a mouse click, hide the outline, turn on
// automatic scrolling and set currentCaptionIndex to point outside of
// caption list (ie -1) to disable mouseenter, mouseleave behavior.
if
(
this
.
videoCaption
.
isMouseFocus
)
{
this
.
videoCaption
.
autoScrolling
=
true
;
caption
.
css
({
'outlineWidth'
:
'0px'
,
'outlineStyle'
:
'none'
});
caption
.
removeClass
(
'focused'
).
addClass
(
'unfocused'
);
this
.
videoCaption
.
currentCaptionIndex
=
-
1
;
}
// If the focus comes from tabbing, show the outline and turn off
// automatic scrolling.
else
{
this
.
videoCaption
.
currentCaptionIndex
=
captionIndex
;
caption
.
css
({
'outlineWidth'
:
'1px'
,
'outlineStyle'
:
'dotted'
});
caption
.
removeClass
(
'unfocused'
).
addClass
(
'focused'
);
// The second and second to last elements turn automatic scrolling
// off again as it may have been enabled in captionBlur.
if
(
captionIndex
<=
1
||
captionIndex
>=
this
.
videoCaption
.
captions
.
length
-
2
)
{
...
...
@@ -411,10 +411,7 @@ function () {
function
captionBlur
(
event
)
{
var
caption
=
$
(
event
.
target
),
captionIndex
=
parseInt
(
caption
.
attr
(
'data-index'
),
10
);
caption
.
css
({
'outlineWidth'
:
'0px'
,
'outlineStyle'
:
'none'
});
caption
.
removeClass
(
'focused'
).
addClass
(
'unfocused'
);
// If we are on first or last index, we have to turn automatic scroll on
// again when losing focus. There is no way to know in what direction we
// are tabbing. So we could be on the first element and tabbing back out
...
...
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