Преглед изворни кода

Fix(React/conference): Sets an initial toolbar view timeout

master
yanas пре 8 година
родитељ
комит
930e65da66
1 измењених фајлова са 18 додато и 5 уклоњено
  1. 18
    5
      react/features/conference/components/Conference.native.js

+ 18
- 5
react/features/conference/components/Conference.native.js Прегледај датотеку

102
     render() {
102
     render() {
103
         const toolbarVisible = this.state.toolbarVisible;
103
         const toolbarVisible = this.state.toolbarVisible;
104
 
104
 
105
+        this._setToolbarTimeout(toolbarVisible);
106
+
105
         return (
107
         return (
106
             <Container
108
             <Container
107
                 onClick = { this._onClick }
109
                 onClick = { this._onClick }
145
 
147
 
146
         this.setState({ toolbarVisible });
148
         this.setState({ toolbarVisible });
147
 
149
 
148
-        this._clearToolbarTimeout();
149
-        if (toolbarVisible) {
150
-            this._toolbarTimeout
151
-                = setTimeout(this._onClick, TOOLBAR_TIMEOUT_MS);
152
-        }
150
+        this._setToolbarTimeout(toolbarVisible);
153
     }
151
     }
154
 
152
 
155
     /**
153
     /**
201
 
199
 
202
         return null;
200
         return null;
203
     }
201
     }
202
+
203
+    /**
204
+     * Triggers the default toolbar timeout.
205
+     *
206
+     * @param {boolean} toolbarVisible - indicates if the toolbar is currently
207
+     * visible
208
+     * @private
209
+     */
210
+    _setToolbarTimeout(toolbarVisible) {
211
+        this._clearToolbarTimeout();
212
+        if (toolbarVisible) {
213
+            this._toolbarTimeout
214
+                = setTimeout(this._onClick, TOOLBAR_TIMEOUT_MS);
215
+        }
216
+    }
204
 }
217
 }
205
 
218
 
206
 /**
219
 /**

Loading…
Откажи
Сачувај