From 1a554828e196a99edfc0c3cf724067b44d31ceee Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 9 Sep 2016 14:37:04 -0500 Subject: [PATCH] Adds option to add custom timeout for hiding toolbar. --- modules/UI/UI.js | 4 ++-- modules/UI/toolbars/ToolbarToggler.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 568fbd2ba..725d98092 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -853,8 +853,8 @@ UI.clickOnVideo = function (videoNumber) { }; //Used by torture -UI.showToolbar = function () { - return ToolbarToggler.showToolbar(); +UI.showToolbar = function (timeout) { + return ToolbarToggler.showToolbar(timeout); }; //Used by torture diff --git a/modules/UI/toolbars/ToolbarToggler.js b/modules/UI/toolbars/ToolbarToggler.js index 33db77b38..4a344cf0a 100644 --- a/modules/UI/toolbars/ToolbarToggler.js +++ b/modules/UI/toolbars/ToolbarToggler.js @@ -89,8 +89,9 @@ const ToolbarToggler = { /** * Shows the main toolbar. + * @param timeout (optional) to specify custom timeout value */ - showToolbar () { + showToolbar (timeout) { if (interfaceConfig.filmStripOnly) { return; } @@ -107,7 +108,8 @@ const ToolbarToggler = { clearTimeout(toolbarTimeoutObject); toolbarTimeoutObject = null; } - toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout); + toolbarTimeoutObject = setTimeout(hideToolbar, + timeout ? timeout : toolbarTimeout); toolbarTimeout = interfaceConfig.TOOLBAR_TIMEOUT; }