Commit 5137b9f8 by Chris Rodriguez

Adding legacy event_type for language menu events

parent f7ec039b
...@@ -374,6 +374,8 @@ class VideoEventTransformer(EventTransformer): ...@@ -374,6 +374,8 @@ class VideoEventTransformer(EventTransformer):
u'edx.video.seeked': u'seek_video', u'edx.video.seeked': u'seek_video',
u'edx.video.transcript.shown': u'show_transcript', u'edx.video.transcript.shown': u'show_transcript',
u'edx.video.transcript.hidden': u'hide_transcript', u'edx.video.transcript.hidden': u'hide_transcript',
u'edx.video.language_menu.shown': u'video_show_cc_menu',
u'edx.video.language_menu.hidden': u'video_hide_cc_menu',
} }
is_legacy_event = True is_legacy_event = True
......
...@@ -117,17 +117,17 @@ ...@@ -117,17 +117,17 @@
}); });
}); });
it('can emit "video_show_cc_menu" event', function () { it('can emit "edx.video.language_menu.shown" event', function () {
state.el.trigger('language_menu:show'); state.el.trigger('language_menu:show');
expect(Logger.log).toHaveBeenCalledWith('video_show_cc_menu', { expect(Logger.log).toHaveBeenCalledWith('edx.video.language_menu.shown', {
id: 'id', id: 'id',
code: 'html5' code: 'html5'
}); });
}); });
it('can emit "video_hide_cc_menu" event', function () { it('can emit "edx.video.language_menu.hidden" event', function () {
state.el.trigger('language_menu:hide'); state.el.trigger('language_menu:hide');
expect(Logger.log).toHaveBeenCalledWith('video_hide_cc_menu', { expect(Logger.log).toHaveBeenCalledWith('edx.video.language_menu.hidden', {
id: 'id', id: 'id',
code: 'html5', code: 'html5',
language: 'en' language: 'en'
......
...@@ -101,11 +101,11 @@ define('video/09_events_plugin.js', [], function() { ...@@ -101,11 +101,11 @@ define('video/09_events_plugin.js', [], function() {
}, },
onShowLanguageMenu: function () { onShowLanguageMenu: function () {
this.log('video_show_cc_menu'); this.log('edx.video.language_menu.shown');
}, },
onHideLanguageMenu: function () { onHideLanguageMenu: function () {
this.log('video_hide_cc_menu', { language: this.getCurrentLanguage() }); this.log('edx.video.language_menu.hidden', { language: this.getCurrentLanguage() });
}, },
onShowCaptions: function () { onShowCaptions: function () {
......
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
// present instead of on the container hover, since it wraps // present instead of on the container hover, since it wraps
// the "CC" and "Transcript" buttons as well. // the "CC" and "Transcript" buttons as well.
if ($(event.currentTarget).find('.lang').length) { if ($(event.currentTarget).find('.lang').length) {
this.state.el.trigger('language_menu:show'); this.state.el.trigger('language_menu:hide');
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment