You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BottomToolbar.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* global $ */
  2. var PanelToggler = require("../side_pannels/SidePanelToggler");
  3. var UIUtil = require("../util/UIUtil");
  4. var buttonHandlers = {
  5. "bottom_toolbar_contact_list": function () {
  6. BottomToolbar.toggleContactList();
  7. },
  8. "bottom_toolbar_film_strip": function () {
  9. BottomToolbar.toggleFilmStrip();
  10. },
  11. "bottom_toolbar_chat": function () {
  12. BottomToolbar.toggleChat();
  13. }
  14. };
  15. var defaultBottomToolbarButtons = {
  16. 'chat': '#bottom_toolbar_chat',
  17. 'contacts': '#bottom_toolbar_contact_list',
  18. 'filmstrip': '#bottom_toolbar_film_strip'
  19. };
  20. var BottomToolbar = (function (my) {
  21. my.init = function () {
  22. UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
  23. for(var k in buttonHandlers)
  24. $("#" + k).click(buttonHandlers[k]);
  25. };
  26. my.toggleChat = function() {
  27. PanelToggler.toggleChat();
  28. };
  29. my.toggleContactList = function() {
  30. PanelToggler.toggleContactList();
  31. };
  32. my.toggleFilmStrip = function() {
  33. var filmstrip = $("#remoteVideos");
  34. filmstrip.toggleClass("hidden");
  35. };
  36. $(document).bind("remotevideo.resized", function (event, width, height) {
  37. var bottom = (height - $('#bottomToolbar').outerHeight())/2 + 18;
  38. $('#bottomToolbar').css({bottom: bottom + 'px'});
  39. });
  40. return my;
  41. }(BottomToolbar || {}));
  42. module.exports = BottomToolbar;