[mobile] Fix bug 51532

This commit is contained in:
JuliaSvinareva 2021-07-27 16:58:54 +03:00
parent aab98b4beb
commit ae7767de66
3 changed files with 114 additions and 64 deletions

View file

@ -28,35 +28,49 @@ class MainPage extends Component {
handleClickToOpenOptions = (opts, showOpts) => {
ContextMenu.closeContextMenu();
this.setState(state => {
if ( opts == 'edit' )
return {editOptionsVisible: true};
else if ( opts == 'add' )
return {
addOptionsVisible: true,
addShowOptions: showOpts
};
else if ( opts == 'settings' )
return {settingsVisible: true};
else if ( opts == 'coauth' )
return {
collaborationVisible: true,
collaborationPage: showOpts
};
});
setTimeout(() => {
let opened = false;
const newState = {};
if ( opts === 'edit' ) {
this.state.editOptionsVisible && (opened = true);
newState.editOptionsVisible = true;
} else if ( opts === 'add' ) {
this.state.addOptionsVisible && (opened = true);
newState.addOptionsVisible = true;
newState.addShowOptions = showOpts;
} else if ( opts === 'settings' ) {
this.state.settingsVisible && (opened = true);
newState.settingsVisible = true;
} else if ( opts === 'coauth' ) {
this.state.collaborationVisible && (opened = true);
newState.collaborationVisible = true;
}
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.hide('.main-navbar');
}
for (let key in this.state) {
if (this.state[key] && !opened) {
setTimeout(() => {
this.handleClickToOpenOptions(opts, showOpts);
}, 10);
return;
}
}
if (!opened) {
this.setState(newState);
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.hide('.main-navbar');
}
}
}, 10);
};
handleOptionsViewClosed = opts => {
(async () => {
await 1 && this.setState(state => {
setTimeout(() => {
this.setState(state => {
if ( opts == 'edit' )
return {editOptionsVisible: false};
else if ( opts == 'add' )
return {addOptionsVisible: false};
return {addOptionsVisible: false, addShowOptions: null};
else if ( opts == 'settings' )
return {settingsVisible: false};
else if ( opts == 'coauth' )
@ -65,7 +79,8 @@ class MainPage extends Component {
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.show('.main-navbar');
}
})();
}, 1);
};
render() {

View file

@ -30,34 +30,52 @@ class MainPage extends Component {
handleClickToOpenOptions = (opts, showOpts) => {
ContextMenu.closeContextMenu();
this.setState(state => {
if ( opts == 'edit' )
return {editOptionsVisible: true};
else if ( opts == 'add' )
return {
addOptionsVisible: true,
addShowOptions: showOpts
};
else if ( opts == 'settings' )
return {settingsVisible: true};
else if ( opts == 'coauth' )
return {collaborationVisible: true};
else if ( opts == 'preview' )
return {previewVisible: true};
});
setTimeout(() => {
let opened = false;
const newState = {};
if ( opts === 'edit' ) {
this.state.editOptionsVisible && (opened = true);
newState.editOptionsVisible = true;
} else if ( opts === 'add' ) {
this.state.addOptionsVisible && (opened = true);
newState.addOptionsVisible = true;
newState.addShowOptions = showOpts;
} else if ( opts === 'settings' ) {
this.state.settingsVisible && (opened = true);
newState.settingsVisible = true;
} else if ( opts === 'coauth' ) {
this.state.collaborationVisible && (opened = true);
newState.collaborationVisible = true;
} else if ( opts === 'preview' ) {
this.state.previewVisible && (opened = true);
newState.previewVisible = true;
}
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.hide('.main-navbar');
}
for (let key in this.state) {
if (this.state[key] && !opened) {
setTimeout(() => {
this.handleClickToOpenOptions(opts, showOpts);
}, 10);
return;
}
}
if (!opened) {
this.setState(newState);
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.hide('.main-navbar');
}
}
}, 10);
};
handleOptionsViewClosed = opts => {
(async () => {
await 1 && this.setState(state => {
setTimeout(() => {
this.setState(state => {
if ( opts == 'edit' )
return {editOptionsVisible: false};
else if ( opts == 'add' )
return {addOptionsVisible: false};
return {addOptionsVisible: false, addShowOptions: null};
else if ( opts == 'settings' )
return {settingsVisible: false};
else if ( opts == 'coauth' )
@ -68,7 +86,7 @@ class MainPage extends Component {
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.show('.main-navbar');
}
})();
});
};
render() {

View file

@ -32,28 +32,45 @@ class MainPage extends Component {
handleClickToOpenOptions = (opts, showOpts) => {
f7.popover.close('.document-menu.modal-in', false);
this.setState(state => {
if ( opts == 'edit' )
return {editOptionsVisible: true};
else if ( opts == 'add' )
return {
addOptionsVisible: true,
addShowOptions: showOpts
};
else if ( opts == 'settings' )
return {settingsVisible: true};
else if ( opts == 'coauth' )
return {collaborationVisible: true};
});
setTimeout(() => {
let opened = false;
const newState = {};
if ( opts === 'edit' ) {
this.state.editOptionsVisible && (opened = true);
newState.editOptionsVisible = true;
} else if ( opts === 'add' ) {
this.state.addOptionsVisible && (opened = true);
newState.addOptionsVisible = true;
newState.addShowOptions = showOpts;
} else if ( opts === 'settings' ) {
this.state.settingsVisible && (opened = true);
newState.settingsVisible = true;
} else if ( opts === 'coauth' ) {
this.state.collaborationVisible && (opened = true);
newState.collaborationVisible = true;
}
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.hide('.main-navbar');
}
for (let key in this.state) {
if (this.state[key] && !opened) {
setTimeout(() => {
this.handleClickToOpenOptions(opts, showOpts);
}, 10);
return;
}
}
if (!opened) {
this.setState(newState);
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.hide('.main-navbar');
}
}
}, 10);
};
handleOptionsViewClosed = opts => {
(async () => {
await 1 && this.setState(state => {
setTimeout(() => {
this.setState(state => {
if ( opts == 'edit' )
return {editOptionsVisible: false};
else if ( opts == 'add' )
@ -66,7 +83,7 @@ class MainPage extends Component {
if ((opts === 'edit' || opts === 'coauth') && Device.phone) {
f7.navbar.show('.main-navbar');
}
})();
}, 1);
};
render() {