2015-07-28 16:52:32 -05:00
|
|
|
/* global $ */
|
2015-01-07 16:54:03 +02:00
|
|
|
var PanelToggler = require("../side_pannels/SidePanelToggler");
|
2015-08-28 16:13:40 -05:00
|
|
|
var UIUtil = require("../util/UIUtil");
|
2015-09-02 12:10:04 -05:00
|
|
|
var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter");
|
2015-01-07 16:54:03 +02:00
|
|
|
|
|
|
|
|
var buttonHandlers = {
|
|
|
|
|
"bottom_toolbar_contact_list": function () {
|
2015-09-02 12:10:04 -05:00
|
|
|
AnalyticsAdapter.sendEvent('bottomtoolbar.contacts.toggled');
|
2015-01-07 16:54:03 +02:00
|
|
|
BottomToolbar.toggleContactList();
|
|
|
|
|
},
|
|
|
|
|
"bottom_toolbar_film_strip": function () {
|
2015-09-02 12:10:04 -05:00
|
|
|
AnalyticsAdapter.sendEvent('bottomtoolbar.filmstrip.toggled');
|
2015-01-07 16:54:03 +02:00
|
|
|
BottomToolbar.toggleFilmStrip();
|
|
|
|
|
},
|
|
|
|
|
"bottom_toolbar_chat": function () {
|
2015-09-02 12:10:04 -05:00
|
|
|
AnalyticsAdapter.sendEvent('bottomtoolbar.chat.toggled');
|
2015-01-07 16:54:03 +02:00
|
|
|
BottomToolbar.toggleChat();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2015-08-28 16:13:40 -05:00
|
|
|
|
|
|
|
|
var defaultBottomToolbarButtons = {
|
|
|
|
|
'chat': '#bottom_toolbar_chat',
|
|
|
|
|
'contacts': '#bottom_toolbar_contact_list',
|
|
|
|
|
'filmstrip': '#bottom_toolbar_film_strip'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2014-08-22 17:37:11 +02:00
|
|
|
var BottomToolbar = (function (my) {
|
2015-01-07 16:54:03 +02:00
|
|
|
my.init = function () {
|
2015-08-28 16:13:40 -05:00
|
|
|
UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
|
|
|
|
|
|
2015-01-07 16:54:03 +02:00
|
|
|
for(var k in buttonHandlers)
|
|
|
|
|
$("#" + k).click(buttonHandlers[k]);
|
|
|
|
|
};
|
|
|
|
|
|
2014-08-22 17:37:11 +02:00
|
|
|
my.toggleChat = function() {
|
2014-10-31 13:47:12 +02:00
|
|
|
PanelToggler.toggleChat();
|
2014-08-22 17:37:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
my.toggleContactList = function() {
|
2014-10-31 13:47:12 +02:00
|
|
|
PanelToggler.toggleContactList();
|
2014-08-22 17:37:11 +02:00
|
|
|
};
|
|
|
|
|
|
2014-09-04 11:15:48 +03:00
|
|
|
my.toggleFilmStrip = function() {
|
2014-09-08 18:34:56 +03:00
|
|
|
var filmstrip = $("#remoteVideos");
|
|
|
|
|
filmstrip.toggleClass("hidden");
|
2014-09-04 11:15:48 +03:00
|
|
|
};
|
|
|
|
|
|
2014-08-22 17:37:11 +02:00
|
|
|
$(document).bind("remotevideo.resized", function (event, width, height) {
|
|
|
|
|
var bottom = (height - $('#bottomToolbar').outerHeight())/2 + 18;
|
|
|
|
|
|
|
|
|
|
$('#bottomToolbar').css({bottom: bottom + 'px'});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return my;
|
|
|
|
|
}(BottomToolbar || {}));
|
2015-01-07 16:54:03 +02:00
|
|
|
|
|
|
|
|
module.exports = BottomToolbar;
|