mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-30 11:33:36 +00:00
Merge pull request #256 from geeeeeeeeek/issue/delay-webview-show-up
Delay webview fade-in.
This commit is contained in:
@@ -208,16 +208,20 @@ body {
|
||||
|
||||
webview {
|
||||
opacity: 1;
|
||||
transition: opacity 0.3s;
|
||||
transition: opacity 0.3s ease-in;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
webview.onload {
|
||||
transition: opacity 1s cubic-bezier(0.95, 0.05, 0.795, 0.035);
|
||||
}
|
||||
|
||||
webview.disabled {
|
||||
flex: 0 1;
|
||||
height: 0;
|
||||
width: 0;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
transition: opacity 0.3s ease-out;
|
||||
}
|
||||
|
||||
webview:focus {
|
||||
|
||||
@@ -59,7 +59,10 @@ class WebView extends BaseComponent {
|
||||
this.props.onTitleChange();
|
||||
});
|
||||
|
||||
this.$el.addEventListener('dom-ready', this.show.bind(this));
|
||||
this.$el.addEventListener('dom-ready', () => {
|
||||
this.$el.classList.add('onload');
|
||||
this.show();
|
||||
});
|
||||
|
||||
this.$el.addEventListener('did-fail-load', event => {
|
||||
const {errorDescription} = event;
|
||||
@@ -92,6 +95,9 @@ class WebView extends BaseComponent {
|
||||
}
|
||||
|
||||
this.$el.classList.remove('disabled');
|
||||
setTimeout(() => {
|
||||
this.$el.classList.remove('onload');
|
||||
}, 1000);
|
||||
this.focus();
|
||||
this.loading = false;
|
||||
this.props.onTitleChange(this.$el.getTitle());
|
||||
|
||||
Reference in New Issue
Block a user