Adds option to add custom timeout for hiding toolbar.

This commit is contained in:
damencho 2016-09-09 14:37:04 -05:00
parent 974a0334df
commit 1a554828e1
2 changed files with 6 additions and 4 deletions

View File

@ -853,8 +853,8 @@ UI.clickOnVideo = function (videoNumber) {
}; };
//Used by torture //Used by torture
UI.showToolbar = function () { UI.showToolbar = function (timeout) {
return ToolbarToggler.showToolbar(); return ToolbarToggler.showToolbar(timeout);
}; };
//Used by torture //Used by torture

View File

@ -89,8 +89,9 @@ const ToolbarToggler = {
/** /**
* Shows the main toolbar. * Shows the main toolbar.
* @param timeout (optional) to specify custom timeout value
*/ */
showToolbar () { showToolbar (timeout) {
if (interfaceConfig.filmStripOnly) { if (interfaceConfig.filmStripOnly) {
return; return;
} }
@ -107,7 +108,8 @@ const ToolbarToggler = {
clearTimeout(toolbarTimeoutObject); clearTimeout(toolbarTimeoutObject);
toolbarTimeoutObject = null; toolbarTimeoutObject = null;
} }
toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout); toolbarTimeoutObject = setTimeout(hideToolbar,
timeout ? timeout : toolbarTimeout);
toolbarTimeout = interfaceConfig.TOOLBAR_TIMEOUT; toolbarTimeout = interfaceConfig.TOOLBAR_TIMEOUT;
} }