[SSE mobile] Add skeleton

This commit is contained in:
JuliaSvinareva 2021-05-17 14:55:21 +03:00
parent 2355a62aa7
commit cd396f147f
4 changed files with 58 additions and 1 deletions

View file

@ -380,6 +380,8 @@ class MainController extends Component {
Common.Gateway.documentReady(); Common.Gateway.documentReady();
f7.emit('resize'); f7.emit('resize');
appOptions.changeDocReady(true);
} }
applyMode (appOptions) { applyMode (appOptions) {

View file

@ -43,3 +43,42 @@
background-color: @white; background-color: @white;
} }
} }
// Skeleton of workbook
.doc-placeholder {
padding-top: calc(var(--f7-page-navbar-offset, 0px) + var(--f7-page-subnavbar-offset, 0px));
overflow: hidden;
background: #fbfbfb;
width: 100%;
height: 100%;
border: 1px solid #dfdfdf;
white-space: nowrap;
position: absolute;
top: 0;
left: 0;
font-size: 0;
z-index: 6000;
> .columns {
width: 100%;
height: 100%;
overflow: hidden;
display: inline-block;
background: linear-gradient(90deg, #d5d5d5 0px, rgba(0,0,0,0) 1px) 0 0,
linear-gradient(rgba(0,0,0,0) 19px, #d5d5d5 20px) 0 0,
linear-gradient( #f1f1f1 0px, #f1f1f1 20px) 0 0 repeat-x;
background-size: 80px 20px;
-webkit-animation: flickerAnimation 2s infinite ease-in-out;
-moz-animation: flickerAnimation 2s infinite ease-in-out;
-o-animation: flickerAnimation 2s infinite ease-in-out;
animation: flickerAnimation 2s infinite ease-in-out;
&:first-child {
background: linear-gradient(#f1f1f1 19px, #d5d5d5 20px) 0 0;
background-size: 20px 20px;
width: 25px;
}
}
}

View file

@ -72,6 +72,7 @@ class MainPage extends Component {
const appOptions = this.props.storeAppOptions; const appOptions = this.props.storeAppOptions;
const config = appOptions.config; const config = appOptions.config;
const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo))); const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo));
return ( return (
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}> <Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
{/* Top Navbar */} {/* Top Navbar */}
@ -85,6 +86,13 @@ class MainPage extends Component {
<CellEditor onClickToOpenAddOptions={(panels, button) => this.handleClickToOpenOptions('add', {panels: panels, button: button})}/> <CellEditor onClickToOpenAddOptions={(panels, button) => this.handleClickToOpenOptions('add', {panels: panels, button: button})}/>
{/* Page content */} {/* Page content */}
<View id="editor_sdk" /> <View id="editor_sdk" />
{showPlaceholder ?
<div className="doc-placeholder">
<div className="columns"></div>
<div className="columns"></div>
</div> :
null
}
<SearchSettings useSuspense={false} /> <SearchSettings useSuspense={false} />
{ {
!this.state.editOptionsVisible ? null : !this.state.editOptionsVisible ? null :

View file

@ -9,7 +9,10 @@ export class storeAppOptions {
setPermissionOptions: action, setPermissionOptions: action,
lostEditingRights: observable, lostEditingRights: observable,
changeEditingRights: action changeEditingRights: action,
isDocReady: observable,
changeDocReady: action
}); });
} }
@ -22,6 +25,11 @@ export class storeAppOptions {
this.lostEditingRights = value; this.lostEditingRights = value;
} }
isDocReady = false;
changeDocReady (value) {
this.isDocReady = value;
}
setConfigOptions (config, _t) { setConfigOptions (config, _t) {
this.config = config; this.config = config;
this.customization = config.customization; this.customization = config.customization;