Merge pull request #1873 from ONLYOFFICE/feature/fix-bugs

Feature/fix bugs
This commit is contained in:
maxkadushkin 2022-07-28 12:46:52 +03:00 committed by GitHub
commit 36b3af56b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 95 deletions

View file

@ -1138,6 +1138,8 @@ input[type="number"]::-webkit-inner-spin-button {
// Navigation list
.list.navigation-list {
overflow-y: auto;
height: 265px;
.item-title {
color: @text-normal;
}

View file

@ -340,7 +340,7 @@ class ContextMenu extends ContextMenuController {
});
}
if(inToc) {
if(inToc && isEdit) {
itemsText.push({
caption: t('ContextMenu.textRefreshEntireTable'),
event: 'refreshEntireTable'

View file

@ -260,12 +260,12 @@ const PageEditStructureTableContents = props => {
<List>
{styles.map((style, index) => {
return (
<ListItem checkbox key={index} title={style.displayValue} checked={style.checked}>
{!isAndroid && <div slot='after-start'>{style.value}</div>}
<ListItem checkbox key={index} title={style.displayValue} checked={style.checked && style.value >= 1}>
{!isAndroid && <div slot='after-start'>{style.value === 0 ? '' : style.value}</div>}
<div slot='after'>
<Segmented>
<Button outline className='decrement item-link' onClick={() => {
if(style.value > 1) {
if(style.value >= 1) {
setAmountLevels(-1);
addNewStyle(style);
props.addStyles(chosenStyles, style.name, style.value - 1);

View file

@ -32,7 +32,7 @@ const NavigationPopover = inject('storeNavigation')(observer(props => {
<List className="navigation-list">
{arrHeaders.map((header, index) => {
return (
<ListItem radio key={index} title={header.isEmptyItem ? t('Settings.textEmptyHeading') : header.name} checked={header.index === currentPosition} style={{paddingLeft: header.level * 16}} onClick={() => {
<ListItem radio key={index} title={header.isEmptyItem ? t('Settings.textBeginningDocument') : header.name} checked={header.index === currentPosition} style={{paddingLeft: header.level * 16}} onClick={() => {
setCurrentPosition(header.index);
props.onSelectItem(header.index);
}}></ListItem>
@ -121,7 +121,7 @@ const NavigationSheet = inject('storeNavigation')(observer(props => {
<List className="navigation-list">
{arrHeaders.map((header, index) => {
return (
<ListItem radio key={index} title={header.isEmptyItem ? t('Settings.textEmptyHeading') : header.name} checked={header.index === currentPosition} style={{paddingLeft: header.level * 16}} onClick={() => {
<ListItem radio key={index} title={header.isEmptyItem ? t('Settings.textBeginningDocument') : header.name} checked={header.index === currentPosition} style={{paddingLeft: header.level * 16}} onClick={() => {
setCurrentPosition(header.index);
props.onSelectItem(header.index);
}}></ListItem>

View file

@ -1,4 +1,3 @@
import React, { useEffect, useState } from 'react';
import CellEditorView from '../view/CellEditor';
import { f7 } from 'framework7-react';
@ -39,7 +38,7 @@ const CellEditor = inject("storeFunctions")(observer(props => {
setFunctionshDisabled(is_image || is_mode_2 || coauth_disable);
}
const onFormulaCompleteMenu = funcArr => {
const onFormulaCompleteMenu = async funcArr => {
const api = Common.EditorApi.get();
const storeFunctions = props.storeFunctions;
const functions = storeFunctions.functions;
@ -94,21 +93,14 @@ const CellEditor = inject("storeFunctions")(observer(props => {
return {name, type, descr, caption, args};
});
setFuncArr(funcArr);
setHintArr(hintArr);
await setFuncArr(funcArr);
await setHintArr(hintArr);
f7.popover.open('#idx-functions-list', '#idx-list-target');
const listTarget = document.querySelector('#idx-list-target');
const rect = listTarget.getBoundingClientRect();
const popoverList = document.querySelector('#idx-functions-list');
popoverList.style.top = `${rect.bottom}px`;
popoverList.style.left = `${rect.left}px`;
await f7.popover.open('#idx-functions-list', '#idx-list-target');
} else {
f7.popover.close('#idx-functions-list');
setFuncArr('');
setHintArr('');
await f7.popover.close('#idx-functions-list');
await setFuncArr('');
await setHintArr('');
}
}

View file

@ -14,78 +14,6 @@ const contentStyle = {
flexGrow: 1
};
const FunctionInfo = props => {
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const functionObj = props.functionObj;
const functionInfo = props.functionInfo;
useEffect(() => {
const functionsList = document.querySelector('#functions-list');
const height = functionsList.offsetHeight + 'px';
functionsList.closest('.view').style.height = '200px';
return () => {
functionsList.closest('.view').style.height = height;
}
}, []);
return (
<Page className='page-function-info'>
<Navbar title={functionInfo.caption} backLink={_t.textBack} backLinkUrl='/functions-list/'>
<NavRight>
<Link text={t('View.Add.textInsert')} onClick={() => props.insertFormula(functionObj.name, functionObj.type)}></Link>
</NavRight>
</Navbar>
<div className='function-info'>
<h3>{functionInfo.caption && functionInfo.args ? `${functionInfo.caption} ${functionInfo.args}` : functionInfo.name}</h3>
<p>{functionInfo.descr}</p>
</div>
</Page>
)
}
const FunctionsList = props => {
const isPhone = Device.isPhone;
const functions = props.functions;
const funcArr = props.funcArr;
const hintArr = props.hintArr;
useEffect(() => {
const functionsList = document.querySelector('#functions-list');
const height = functionsList.offsetHeight + 'px';
functionsList.closest('.view').style.height = height;
}, [funcArr]);
return (
<div id="functions-list" className={isPhone ? 'functions-list functions-list__mobile' : 'functions-list'}>
<List>
{funcArr && funcArr.length && funcArr.map((elem, index) => {
return (
<ListItem key={index} title={elem.name} className="no-indicator" onClick={() => props.insertFormula(elem.name, elem.type)}>
{(functions[elem.name] || hintArr[index]?.descr) &&
<div slot='after'
onClick={(e) => {
e.stopPropagation();
let functionInfo = functions[elem.name] || hintArr[index];
if(functionInfo) {
f7.views.current.router.navigate('/function-info/', {props: {functionInfo, functionObj: elem, insertFormula: props.insertFormula}});
}
}}>
<Icon icon='icon-info'/>
</div>
}
</ListItem>
)
})}
</List>
</div>
)
}
const CellEditorView = props => {
const [expanded, setExpanded] = useState(false);
const isPhone = Device.isPhone;
@ -147,6 +75,80 @@ const CellEditorView = props => {
);
};
const FunctionsList = props => {
const isPhone = Device.isPhone;
const functions = props.functions;
const funcArr = props.funcArr;
const hintArr = props.hintArr;
const functionsList = document.querySelector('#functions-list');
useEffect(() => {
if(functionsList) {
const height = functionsList.offsetHeight + 'px';
functionsList.closest('.view').style.height = height;
}
}, [funcArr]);
return (
<div id="functions-list" className={isPhone ? 'functions-list functions-list__mobile' : 'functions-list'}>
<List>
{funcArr && funcArr.length && funcArr.map((elem, index) => {
return (
<ListItem key={index} title={elem.name} className="no-indicator" onClick={() => props.insertFormula(elem.name, elem.type)}>
{(functions[elem.name] || hintArr[index]?.descr) &&
<div slot='after'
onClick={(e) => {
e.stopPropagation();
let functionInfo = functions[elem.name] || hintArr[index];
if(functionInfo) {
f7.views.current.router.navigate('/function-info/', {props: {functionInfo, functionObj: elem, insertFormula: props.insertFormula}});
}
}}>
<Icon icon='icon-info'/>
</div>
}
</ListItem>
)
})}
</List>
</div>
)
}
const FunctionInfo = props => {
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const functionObj = props.functionObj;
const functionInfo = props.functionInfo;
const functionsList = document.querySelector('#functions-list');
useEffect(() => {
if(functionsList) {
const height = functionsList.offsetHeight + 'px';
functionsList.closest('.view').style.height = '200px';
return () => {
functionsList.closest('.view').style.height = height;
}
}
}, [functionsList]);
return (
<Page className='page-function-info'>
<Navbar title={functionInfo.caption} backLink={_t.textBack} backLinkUrl='/functions-list/'>
<NavRight>
<Link text={t('View.Add.textInsert')} onClick={() => props.insertFormula(functionObj.name, functionObj.type)}></Link>
</NavRight>
</Navbar>
<div className='function-info'>
<h3>{functionInfo.caption && functionInfo.args ? `${functionInfo.caption} ${functionInfo.args}` : functionInfo.name}</h3>
<p>{functionInfo.descr}</p>
</div>
</Page>
)
}
const routes = [
{
path: '/function-info/',