浏览代码

ref(always-on-top): trigger toolbar hide timeout after update

j8
Leonard Kim 7 年前
父节点
当前提交
14adc0b887
共有 1 个文件被更改,包括 12 次插入12 次删除
  1. 12
    12
      react/features/always-on-top/AlwaysOnTop.js

+ 12
- 12
react/features/always-on-top/AlwaysOnTop.js 查看文件

205
         this._hideToolbarAfterTimeout();
205
         this._hideToolbarAfterTimeout();
206
     }
206
     }
207
 
207
 
208
+    /**
209
+     * Sets a timeout to hide the toolbar when the toolbar is shown.
210
+     *
211
+     * @inheritdoc
212
+     * @returns {void}
213
+     */
214
+    componentDidUpdate(prevProps: *, prevState: State) {
215
+        if (!prevState.visible && this.state.visible) {
216
+            this._hideToolbarAfterTimeout();
217
+        }
218
+    }
219
+
208
     /**
220
     /**
209
      * Removes all listeners.
221
      * Removes all listeners.
210
      *
222
      *
223
         window.removeEventListener('mousemove', this._mouseMove);
235
         window.removeEventListener('mousemove', this._mouseMove);
224
     }
236
     }
225
 
237
 
226
-    /**
227
-     * Sets a timeout to hide the toolbar when the toolbar is shown.
228
-     *
229
-     * @inheritdoc
230
-     * @returns {void}
231
-     */
232
-    componentWillUpdate(nextProps: *, nextState: State) {
233
-        if (!this.state.visible && nextState.visible) {
234
-            this._hideToolbarAfterTimeout();
235
-        }
236
-    }
237
-
238
     /**
238
     /**
239
      * Implements React's {@link Component#render()}.
239
      * Implements React's {@link Component#render()}.
240
      *
240
      *

正在加载...
取消
保存