From 20c6dba599fb675b4b943bf8aa0ec44c7ee37958 Mon Sep 17 00:00:00 2001 From: Ilya Daynatovich Date: Wed, 9 Nov 2016 12:41:23 +0200 Subject: [PATCH 1/2] Moved keyboard initialization to filmstrip toolbar; Replaced toggle filmstrip button from extended toolbar --- modules/UI/toolbars/Toolbar.js | 16 ---------------- modules/UI/videolayout/FilmStrip.js | 25 ++++++++++++++++++++++++- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index f7d4c4c5f..0517090cb 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -117,10 +117,6 @@ const buttonHandlers = { } }); }, - "toolbar_film_strip": function () { - JitsiMeetJS.analytics.sendEvent('toolbar.filmstrip.toggled'); - emitter.emit(UIEvents.TOGGLE_FILM_STRIP); - }, "toolbar_button_raisehand": function () { JitsiMeetJS.analytics.sendEvent('toolbar.raiseHand.clicked'); APP.conference.maybeToggleRaisedHand(); @@ -261,18 +257,6 @@ const defaultToolbarButtons = { content: "Hang Up", i18n: "[content]toolbar.hangup" }, - 'filmstrip': { - id: 'toolbar_film_strip', - tooltipKey: 'toolbar.filmstrip', - className: "button icon-toggle-filmstrip", - shortcut: "F", - shortcutAttr: "filmstripPopover", - shortcutFunc: function() { - JitsiMeetJS.analytics.sendEvent("shortcut.film.toggled"); - APP.UI.toggleFilmStrip(); - }, - shortcutDescription: "keyboardShortcuts.toggleFilmstrip" - }, 'raisehand': { id: "toolbar_button_raisehand", tooltipKey: 'toolbar.raiseHand', diff --git a/modules/UI/videolayout/FilmStrip.js b/modules/UI/videolayout/FilmStrip.js index 2b9b0b3e4..38f5bae55 100644 --- a/modules/UI/videolayout/FilmStrip.js +++ b/modules/UI/videolayout/FilmStrip.js @@ -1,4 +1,4 @@ -/* global $, interfaceConfig */ +/* global $, APP, JitsiMeetJS, interfaceConfig */ import UIEvents from "../../../service/UI/UIEvents"; import UIUtil from "../util/UIUtil"; @@ -58,6 +58,29 @@ const FilmStrip = { let toggleFilmstripMethod = this.toggleFilmStrip.bind(this); let selector = '#hideVideoToolbar'; $('#videospace').on('click', selector, toggleFilmstripMethod); + + this._registerToggleFilmstripShortcut(); + }, + + /** + * Registering toggle filmstrip shortcut + * @private + */ + _registerToggleFilmstripShortcut() { + let shortcut = 'F'; + let shortcutAttr = 'filmstripPopover'; + let description = 'keyboardShortcuts.toggleFilmstrip'; + let handler = () => { + JitsiMeetJS.analytics.sendEvent('toolbar.filmstrip.toggled'); + APP.UI.toggleFilmStrip(); + }; + + APP.keyboardshortcut.registerShortcut( + shortcut, + shortcutAttr, + handler, + description + ); }, /** From 986c29ca5d5403c97c6d25a5440c13c6ade6a6a6 Mon Sep 17 00:00:00 2001 From: Ilya Daynatovich Date: Thu, 10 Nov 2016 12:18:33 +0200 Subject: [PATCH 2/2] updated filmstrip handler --- modules/UI/videolayout/FilmStrip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/UI/videolayout/FilmStrip.js b/modules/UI/videolayout/FilmStrip.js index 38f5bae55..a1aadd613 100644 --- a/modules/UI/videolayout/FilmStrip.js +++ b/modules/UI/videolayout/FilmStrip.js @@ -72,7 +72,7 @@ const FilmStrip = { let description = 'keyboardShortcuts.toggleFilmstrip'; let handler = () => { JitsiMeetJS.analytics.sendEvent('toolbar.filmstrip.toggled'); - APP.UI.toggleFilmStrip(); + this.eventEmitter.emit(UIEvents.TOGGLE_FILM_STRIP); }; APP.keyboardshortcut.registerShortcut(