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
9f95c358
Commit
9f95c358
authored
Apr 22, 2016
by
clrux
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12198 from edx/clrux/ac-383
AC-383 language menu events only when menu opens
parents
66e2d062
665b3dcf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
9 deletions
+22
-9
common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js
+2
-1
common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js
+6
-1
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
+14
-7
No files found.
common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js
View file @
9f95c358
...
...
@@ -130,7 +130,8 @@
state
.
el
.
trigger
(
'language_menu:hide'
);
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'video_hide_cc_menu'
,
{
id
:
'id'
,
code
:
'html5'
code
:
'html5'
,
language
:
'en'
});
});
...
...
common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js
View file @
9f95c358
...
...
@@ -105,7 +105,7 @@ define('video/09_events_plugin.js', [], function() {
},
onHideLanguageMenu
:
function
()
{
this
.
log
(
'video_hide_cc_menu'
);
this
.
log
(
'video_hide_cc_menu'
,
{
language
:
this
.
getCurrentLanguage
()
}
);
},
onShowCaptions
:
function
()
{
...
...
@@ -121,6 +121,11 @@ define('video/09_events_plugin.js', [], function() {
return
player
?
player
.
currentTime
:
0
;
},
getCurrentLanguage
:
function
()
{
var
language
=
this
.
state
.
lang
;
return
language
;
},
log
:
function
(
eventName
,
data
)
{
var
logInfo
=
_
.
extend
({
id
:
this
.
state
.
id
,
...
...
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
View file @
9f95c358
...
...
@@ -325,9 +325,6 @@
var
button
=
this
.
languageChooserEl
,
menu
=
button
.
parent
().
find
(
'.menu'
);
this
.
state
.
el
.
trigger
(
'language_menu:show'
);
button
.
addClass
(
'is-opened'
);
...
...
@@ -341,8 +338,6 @@
var
button
=
this
.
languageChooserEl
;
this
.
state
.
el
.
trigger
(
'language_menu:hide'
);
button
.
removeClass
(
'is-opened'
)
.
find
(
'.language-menu'
)
...
...
@@ -381,7 +376,13 @@
onContainerMouseEnter
:
function
(
event
)
{
event
.
preventDefault
();
$
(
event
.
currentTarget
).
find
(
'.lang'
).
addClass
(
'is-opened'
);
this
.
state
.
el
.
trigger
(
'language_menu:show'
);
// We only want to fire the analytics event if a menu is
// present instead of on the container hover, since it wraps
// the "CC" and "Transcript" buttons as well.
if
(
$
(
event
.
currentTarget
).
find
(
'.lang'
).
length
)
{
this
.
state
.
el
.
trigger
(
'language_menu:show'
);
}
},
/**
...
...
@@ -392,7 +393,13 @@
onContainerMouseLeave
:
function
(
event
)
{
event
.
preventDefault
();
$
(
event
.
currentTarget
).
find
(
'.lang'
).
removeClass
(
'is-opened'
);
this
.
state
.
el
.
trigger
(
'language_menu:hide'
);
// We only want to fire the analytics event if a menu is
// present instead of on the container hover, since it wraps
// the "CC" and "Transcript" buttons as well.
if
(
$
(
event
.
currentTarget
).
find
(
'.lang'
).
length
)
{
this
.
state
.
el
.
trigger
(
'language_menu:show'
);
}
},
/**
...
...
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