Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

toolbar_toggler.js 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. var ToolbarToggler = (function(my) {
  2. var INITIAL_TOOLBAR_TIMEOUT = 20000;
  3. var TOOLBAR_TIMEOUT = INITIAL_TOOLBAR_TIMEOUT;
  4. var toolbarTimeout;
  5. /**
  6. * Shows the main toolbar.
  7. */
  8. my.showToolbar = function() {
  9. var header = $("#header"),
  10. bottomToolbar = $("#bottomToolbar");
  11. if (!header.is(':visible') || !bottomToolbar.is(":visible")) {
  12. header.show("slide", { direction: "up", duration: 300});
  13. $('#subject').animate({top: "+=40"}, 300);
  14. if(!bottomToolbar.is(":visible")) {
  15. bottomToolbar.show("slide", {direction: "right",duration: 300});
  16. }
  17. if (toolbarTimeout) {
  18. clearTimeout(toolbarTimeout);
  19. toolbarTimeout = null;
  20. }
  21. toolbarTimeout = setTimeout(hideToolbar, TOOLBAR_TIMEOUT);
  22. TOOLBAR_TIMEOUT = 4000;
  23. }
  24. if (focus != null)
  25. {
  26. // TODO: Enable settings functionality. Need to uncomment the settings button in index.html.
  27. // $('#settingsButton').css({visibility:"visible"});
  28. }
  29. // Show/hide desktop sharing button
  30. showDesktopSharingButton();
  31. };
  32. /**
  33. * Hides the toolbar.
  34. */
  35. var hideToolbar = function () {
  36. var header = $("#header"),
  37. bottomToolbar = $("#bottomToolbar");
  38. var isToolbarHover = false;
  39. header.find('*').each(function () {
  40. var id = $(this).attr('id');
  41. if ($("#" + id + ":hover").length > 0) {
  42. isToolbarHover = true;
  43. }
  44. });
  45. if($("#bottomToolbar:hover").length > 0) {
  46. isToolbarHover = true;
  47. }
  48. clearTimeout(toolbarTimeout);
  49. toolbarTimeout = null;
  50. if (!isToolbarHover) {
  51. header.hide("slide", { direction: "up", duration: 300});
  52. $('#subject').animate({top: "-=40"}, 300);
  53. if($("#remoteVideos").hasClass("hidden")) {
  54. bottomToolbar.hide("slide", {direction: "right", duration: 300});
  55. }
  56. }
  57. else {
  58. toolbarTimeout = setTimeout(hideToolbar, TOOLBAR_TIMEOUT);
  59. }
  60. };
  61. /**
  62. * Docks/undocks the toolbar.
  63. *
  64. * @param isDock indicates what operation to perform
  65. */
  66. my.dockToolbar = function(isDock) {
  67. if (isDock) {
  68. // First make sure the toolbar is shown.
  69. if (!$('#header').is(':visible')) {
  70. ToolbarToggler.showToolbar();
  71. }
  72. // Then clear the time out, to dock the toolbar.
  73. if (toolbarTimeout) {
  74. clearTimeout(toolbarTimeout);
  75. toolbarTimeout = null;
  76. }
  77. }
  78. else {
  79. if (!$('#header').is(':visible')) {
  80. ToolbarToggler.showToolbar();
  81. }
  82. else {
  83. toolbarTimeout = setTimeout(hideToolbar, TOOLBAR_TIMEOUT);
  84. }
  85. }
  86. };
  87. return my;
  88. }(ToolbarToggler || {}));