ref(always-on-top): trigger toolbar hide timeout after update
This commit is contained in:
parent
c288d0e18c
commit
14adc0b887
|
@ -205,6 +205,18 @@ export default class AlwaysOnTop extends Component<*, State> {
|
|||
this._hideToolbarAfterTimeout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a timeout to hide the toolbar when the toolbar is shown.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {void}
|
||||
*/
|
||||
componentDidUpdate(prevProps: *, prevState: State) {
|
||||
if (!prevState.visible && this.state.visible) {
|
||||
this._hideToolbarAfterTimeout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all listeners.
|
||||
*
|
||||
|
@ -223,18 +235,6 @@ export default class AlwaysOnTop extends Component<*, State> {
|
|||
window.removeEventListener('mousemove', this._mouseMove);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a timeout to hide the toolbar when the toolbar is shown.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {void}
|
||||
*/
|
||||
componentWillUpdate(nextProps: *, nextState: State) {
|
||||
if (!this.state.visible && nextState.visible) {
|
||||
this._hideToolbarAfterTimeout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue