ソースを参照

Adds option to add custom timeout for hiding toolbar.

master
damencho 8年前
コミット
1a554828e1
2個のファイルの変更6行の追加4行の削除
  1. 2
    2
      modules/UI/UI.js
  2. 4
    2
      modules/UI/toolbars/ToolbarToggler.js

+ 2
- 2
modules/UI/UI.js ファイルの表示

@@ -853,8 +853,8 @@ UI.clickOnVideo = function (videoNumber) {
853 853
 };
854 854
 
855 855
 //Used by torture
856
-UI.showToolbar = function () {
857
-    return ToolbarToggler.showToolbar();
856
+UI.showToolbar = function (timeout) {
857
+    return ToolbarToggler.showToolbar(timeout);
858 858
 };
859 859
 
860 860
 //Used by torture

+ 4
- 2
modules/UI/toolbars/ToolbarToggler.js ファイルの表示

@@ -89,8 +89,9 @@ const ToolbarToggler = {
89 89
 
90 90
     /**
91 91
      * Shows the main toolbar.
92
+     * @param timeout (optional) to specify custom timeout value
92 93
      */
93
-    showToolbar () {
94
+    showToolbar (timeout) {
94 95
         if (interfaceConfig.filmStripOnly) {
95 96
             return;
96 97
         }
@@ -107,7 +108,8 @@ const ToolbarToggler = {
107 108
                 clearTimeout(toolbarTimeoutObject);
108 109
                 toolbarTimeoutObject = null;
109 110
             }
110
-            toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
111
+            toolbarTimeoutObject = setTimeout(hideToolbar,
112
+                timeout ? timeout : toolbarTimeout);
111 113
             toolbarTimeout = interfaceConfig.TOOLBAR_TIMEOUT;
112 114
         }
113 115
 

読み込み中…
キャンセル
保存