2014-09-04 13:18:28 +00:00
|
|
|
var ToolbarToggler = (function(my) {
|
2014-09-18 12:39:40 +00:00
|
|
|
var toolbarTimeoutObject,
|
|
|
|
toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
|
2014-09-04 13:18:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the main toolbar.
|
|
|
|
*/
|
|
|
|
my.showToolbar = function() {
|
|
|
|
var header = $("#header"),
|
|
|
|
bottomToolbar = $("#bottomToolbar");
|
|
|
|
if (!header.is(':visible') || !bottomToolbar.is(":visible")) {
|
|
|
|
header.show("slide", { direction: "up", duration: 300});
|
|
|
|
$('#subject').animate({top: "+=40"}, 300);
|
|
|
|
if(!bottomToolbar.is(":visible")) {
|
2014-09-18 07:12:54 +00:00
|
|
|
bottomToolbar.show("slide", {direction: "right",duration: 300});
|
2014-09-04 13:18:28 +00:00
|
|
|
}
|
|
|
|
|
2014-09-18 12:39:40 +00:00
|
|
|
if (toolbarTimeoutObject) {
|
|
|
|
clearTimeout(toolbarTimeoutObject);
|
|
|
|
toolbarTimeoutObject = null;
|
2014-09-04 13:18:28 +00:00
|
|
|
}
|
2014-09-18 12:39:40 +00:00
|
|
|
toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
|
|
|
|
toolbarTimeout = interfaceConfig.TOOLBAR_TIMEOUT;
|
2014-09-04 13:18:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (focus != null)
|
|
|
|
{
|
|
|
|
// TODO: Enable settings functionality. Need to uncomment the settings button in index.html.
|
|
|
|
// $('#settingsButton').css({visibility:"visible"});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Show/hide desktop sharing button
|
|
|
|
showDesktopSharingButton();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides the toolbar.
|
|
|
|
*/
|
|
|
|
var hideToolbar = function () {
|
|
|
|
var header = $("#header"),
|
|
|
|
bottomToolbar = $("#bottomToolbar");
|
|
|
|
var isToolbarHover = false;
|
|
|
|
header.find('*').each(function () {
|
|
|
|
var id = $(this).attr('id');
|
|
|
|
if ($("#" + id + ":hover").length > 0) {
|
|
|
|
isToolbarHover = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if($("#bottomToolbar:hover").length > 0) {
|
|
|
|
isToolbarHover = true;
|
|
|
|
}
|
|
|
|
|
2014-09-18 12:39:40 +00:00
|
|
|
clearTimeout(toolbarTimeoutObject);
|
|
|
|
toolbarTimeoutObject = null;
|
2014-09-04 13:18:28 +00:00
|
|
|
|
|
|
|
if (!isToolbarHover) {
|
|
|
|
header.hide("slide", { direction: "up", duration: 300});
|
|
|
|
$('#subject').animate({top: "-=40"}, 300);
|
2014-09-18 07:12:54 +00:00
|
|
|
if($("#remoteVideos").hasClass("hidden")) {
|
|
|
|
bottomToolbar.hide("slide", {direction: "right", duration: 300});
|
2014-09-04 13:18:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2014-09-18 12:39:40 +00:00
|
|
|
toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
|
2014-09-04 13:18:28 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Docks/undocks the toolbar.
|
|
|
|
*
|
|
|
|
* @param isDock indicates what operation to perform
|
|
|
|
*/
|
|
|
|
my.dockToolbar = function(isDock) {
|
|
|
|
if (isDock) {
|
|
|
|
// First make sure the toolbar is shown.
|
|
|
|
if (!$('#header').is(':visible')) {
|
|
|
|
ToolbarToggler.showToolbar();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Then clear the time out, to dock the toolbar.
|
2014-09-18 12:39:40 +00:00
|
|
|
if (toolbarTimeoutObject) {
|
|
|
|
clearTimeout(toolbarTimeoutObject);
|
|
|
|
toolbarTimeoutObject = null;
|
2014-09-04 13:18:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!$('#header').is(':visible')) {
|
|
|
|
ToolbarToggler.showToolbar();
|
|
|
|
}
|
|
|
|
else {
|
2014-09-18 12:39:40 +00:00
|
|
|
toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
|
2014-09-04 13:18:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return my;
|
|
|
|
}(ToolbarToggler || {}));
|