jiti-meet/modules/UI/toolbars/BottomToolbar.js

49 lines
1.5 KiB
JavaScript
Raw Normal View History

/* global $ */
2015-12-10 16:36:03 +00:00
import UIUtil from '../util/UIUtil';
import UIEvents from '../../../service/UI/UIEvents';
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
2015-11-13 17:04:49 +00:00
2015-12-10 16:36:03 +00:00
const defaultBottomToolbarButtons = {
'chat': '#bottom_toolbar_chat',
'contacts': '#bottom_toolbar_contact_list',
'filmstrip': '#bottom_toolbar_film_strip'
};
2015-12-10 16:36:03 +00:00
const BottomToolbar = {
init (emitter) {
UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
2015-12-10 16:36:03 +00:00
const buttonHandlers = {
"bottom_toolbar_contact_list": function () {
AnalyticsAdapter.sendEvent('bottomtoolbar.contacts.toggled');
emitter.emit(UIEvents.TOGGLE_CONTACT_LIST);
},
"bottom_toolbar_film_strip": function () {
AnalyticsAdapter.sendEvent('bottomtoolbar.filmstrip.toggled');
emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
},
"bottom_toolbar_chat": function () {
AnalyticsAdapter.sendEvent('bottomtoolbar.chat.toggled');
emitter.emit(UIEvents.TOGGLE_CHAT);
}
};
Object.keys(buttonHandlers).forEach(
buttonId => $(`#${buttonId}`).click(buttonHandlers[buttonId])
);
},
2015-12-10 16:36:03 +00:00
toggleFilmStrip () {
$("#remoteVideos").toggleClass("hidden");
2015-12-25 16:55:45 +00:00
},
onRemoteVideoResized (width, height) {
let toolbar = $('#bottomToolbar');
let bottom = (height - toolbar.outerHeight())/2 + 18;
toolbar.css({bottom});
2015-12-10 16:36:03 +00:00
}
};
2015-01-07 14:54:03 +00:00
2015-12-10 16:36:03 +00:00
export default BottomToolbar;