Merge pull request #1242 from ONLYOFFICE/feature/fix-bug-reactjs
Feature/fix bug reactjs
This commit is contained in:
commit
938e916508
|
@ -108,9 +108,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.swiper-container {
|
||||||
|
height: 100%;
|
||||||
.swiper-pagination-bullet-active{
|
.swiper-pagination-bullet-active{
|
||||||
background: @black;
|
background: @black;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -184,12 +184,12 @@ const PageReplace = props => {
|
||||||
</Navbar>
|
</Navbar>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={_t.textPictureFromLibrary} onClick={() => {props.onReplaceByFile()}}>
|
<ListItem title={_t.textPictureFromLibrary} onClick={() => {props.onReplaceByFile()}}>
|
||||||
<Icon slot="media" icon="icon-link"></Icon>
|
<Icon slot="media" icon="icon-image-library"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem title={_t.textPictureFromURL} link='/edit-image-link/' routeProps={{
|
<ListItem title={_t.textPictureFromURL} link='/edit-image-link/' routeProps={{
|
||||||
onReplaceByUrl: props.onReplaceByUrl
|
onReplaceByUrl: props.onReplaceByUrl
|
||||||
}}>
|
}}>
|
||||||
<Icon slot="media" icon="icon-image-library"></Icon>
|
<Icon slot="media" icon="icon-link"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -372,7 +372,7 @@
|
||||||
"textTopLeft": "Top-Left",
|
"textTopLeft": "Top-Left",
|
||||||
"textTopRight": "Top-Right",
|
"textTopRight": "Top-Right",
|
||||||
"textTotalRow": "Total Row",
|
"textTotalRow": "Total Row",
|
||||||
"textTransition": "Transition",
|
"textTransitions": "Transitions",
|
||||||
"textType": "Type",
|
"textType": "Type",
|
||||||
"textUnCover": "UnCover",
|
"textUnCover": "UnCover",
|
||||||
"textVerticalIn": "Vertical In",
|
"textVerticalIn": "Vertical In",
|
||||||
|
|
|
@ -34,7 +34,7 @@ const ToolbarView = props => {
|
||||||
onEditClick: () => props.openOptions('edit'),
|
onEditClick: () => props.openOptions('edit'),
|
||||||
onAddClick: () => props.openOptions('add')
|
onAddClick: () => props.openOptions('add')
|
||||||
})}
|
})}
|
||||||
{ Device.phone ? null : <Link className={props.disabledControls && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link> }
|
{ Device.phone ? null : <Link className={(props.disabledControls || props.disabledPreview) && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link> }
|
||||||
{props.displayCollaboration && window.matchMedia("(min-width: 375px)").matches ? <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={() => props.openOptions('coauth')}></Link> : null}
|
{props.displayCollaboration && window.matchMedia("(min-width: 375px)").matches ? <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={() => props.openOptions('coauth')}></Link> : null}
|
||||||
<Link className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={() => props.openOptions('settings')}></Link>
|
<Link className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={() => props.openOptions('settings')}></Link>
|
||||||
</NavRight>
|
</NavRight>
|
||||||
|
|
|
@ -149,12 +149,12 @@ const PageReplace = props => {
|
||||||
</Navbar>
|
</Navbar>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={_t.textPictureFromLibrary} onClick={() => {props.onReplaceByFile()}}>
|
<ListItem title={_t.textPictureFromLibrary} onClick={() => {props.onReplaceByFile()}}>
|
||||||
<Icon slot="media" icon="icon-link"></Icon>
|
<Icon slot="media" icon="icon-image-library"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem title={_t.textPictureFromURL} link='/edit-image-link/' routeProps={{
|
<ListItem title={_t.textPictureFromURL} link='/edit-image-link/' routeProps={{
|
||||||
onReplaceByUrl: props.onReplaceByUrl
|
onReplaceByUrl: props.onReplaceByUrl
|
||||||
}}>
|
}}>
|
||||||
<Icon slot="media" icon="icon-image-library"></Icon>
|
<Icon slot="media" icon="icon-link"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -19,7 +19,7 @@ const EditSlide = props => {
|
||||||
<ListItem title={_t.textLayout} link="/layout/" routeProps={{
|
<ListItem title={_t.textLayout} link="/layout/" routeProps={{
|
||||||
onLayoutClick: props.onLayoutClick
|
onLayoutClick: props.onLayoutClick
|
||||||
}}></ListItem>
|
}}></ListItem>
|
||||||
<ListItem title={_t.textTransition} link="/transition/" routeProps={{
|
<ListItem title={t('View.Edit.textTransitions')} link="/transition/" routeProps={{
|
||||||
onEffectClick: props.onEffectClick,
|
onEffectClick: props.onEffectClick,
|
||||||
onEffectTypeClick: props.onEffectTypeClick,
|
onEffectTypeClick: props.onEffectTypeClick,
|
||||||
changeDuration: props.changeDuration,
|
changeDuration: props.changeDuration,
|
||||||
|
@ -225,7 +225,7 @@ const PageTransition = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page className="slide-transition">
|
<Page className="slide-transition">
|
||||||
<Navbar title={_t.textTransition} backLink={_t.textBack}>
|
<Navbar title={t('View.Edit.textTransitions')} backLink={_t.textBack}>
|
||||||
{Device.phone &&
|
{Device.phone &&
|
||||||
<NavRight>
|
<NavRight>
|
||||||
<Link sheetClose='#edit-sheet'>
|
<Link sheetClose='#edit-sheet'>
|
||||||
|
|
|
@ -57,9 +57,12 @@ const routes = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
const SettingsList = inject("storeAppOptions")(observer(props => {
|
const SettingsList = inject("storeAppOptions", "storeToolbarSettings")(observer(props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('View.Settings', {returnObjects: true});
|
const _t = t('View.Settings', {returnObjects: true});
|
||||||
|
const storeToolbarSettings = props.storeToolbarSettings;
|
||||||
|
const disabledPreview = storeToolbarSettings.countPages <= 0;
|
||||||
|
|
||||||
const navbar = <Navbar title={_t.textSettings}>
|
const navbar = <Navbar title={_t.textSettings}>
|
||||||
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
|
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
|
||||||
</Navbar>;
|
</Navbar>;
|
||||||
|
@ -121,7 +124,7 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
||||||
{navbar}
|
{navbar}
|
||||||
<List>
|
<List>
|
||||||
{!props.inPopover &&
|
{!props.inPopover &&
|
||||||
<ListItem disabled={appOptions.readerMode ? true : false} title={!_isEdit ? _t.textFind : _t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
|
<ListItem disabled={appOptions.readerMode || disabledPreview ? true : false} title={!_isEdit ? _t.textFind : _t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
|
||||||
<Icon slot="media" icon="icon-search"></Icon>
|
<Icon slot="media" icon="icon-search"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
}
|
}
|
||||||
|
@ -141,7 +144,7 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
||||||
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}>
|
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}>
|
||||||
<Icon slot="media" icon="icon-download"></Icon>
|
<Icon slot="media" icon="icon-download"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem title={_t.textPrint} onClick={onPrint}>
|
<ListItem className={disabledPreview && 'disabled'} title={_t.textPrint} onClick={onPrint}>
|
||||||
<Icon slot="media" icon="icon-print"></Icon>
|
<Icon slot="media" icon="icon-print"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem title={_t.textPresentationInfo} link="#" onClick={onoptionclick.bind(this, "/presentation-info/")}>
|
<ListItem title={_t.textPresentationInfo} link="#" onClick={onoptionclick.bind(this, "/presentation-info/")}>
|
||||||
|
|
|
@ -14,7 +14,7 @@ const CellEditor = props => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const [cellName, setCellName] = useState('');
|
const [cellName, setCellName] = useState('');
|
||||||
const [stateCoauth, setCoauthDisabled] = useState(null);
|
const [stateFunctions, setFunctionshDisabled] = useState(null);
|
||||||
const [stateFuncArr, setFuncArr] = useState('');
|
const [stateFuncArr, setFuncArr] = useState('');
|
||||||
|
|
||||||
const onApiCellSelection = info => {
|
const onApiCellSelection = info => {
|
||||||
|
@ -22,7 +22,17 @@ const CellEditor = props => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onApiSelectionChanged = info => {
|
const onApiSelectionChanged = info => {
|
||||||
setCoauthDisabled(info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true);
|
let seltype = info.asc_getSelectionType(),
|
||||||
|
coauth_disable = info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true;
|
||||||
|
|
||||||
|
let is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,
|
||||||
|
is_chart = seltype == Asc.c_oAscSelectionType.RangeChart,
|
||||||
|
is_shape_text = seltype == Asc.c_oAscSelectionType.RangeShapeText,
|
||||||
|
is_shape = seltype == Asc.c_oAscSelectionType.RangeShape,
|
||||||
|
is_image = seltype == Asc.c_oAscSelectionType.RangeImage || seltype == Asc.c_oAscSelectionType.RangeSlicer,
|
||||||
|
is_mode_2 = is_shape_text || is_shape || is_chart_text || is_chart;
|
||||||
|
|
||||||
|
setFunctionshDisabled(is_image || is_mode_2 || coauth_disable);
|
||||||
}
|
}
|
||||||
|
|
||||||
const onFormulaCompleteMenu = funcArr => {
|
const onFormulaCompleteMenu = funcArr => {
|
||||||
|
@ -43,7 +53,7 @@ const CellEditor = props => {
|
||||||
return (
|
return (
|
||||||
<CellEditorView
|
<CellEditorView
|
||||||
cellName={cellName}
|
cellName={cellName}
|
||||||
stateCoauth={stateCoauth}
|
stateFunctions={stateFunctions}
|
||||||
onClickToOpenAddOptions={props.onClickToOpenAddOptions}
|
onClickToOpenAddOptions={props.onClickToOpenAddOptions}
|
||||||
funcArr={stateFuncArr}
|
funcArr={stateFuncArr}
|
||||||
insertFormula={insertFormula}
|
insertFormula={insertFormula}
|
||||||
|
|
|
@ -395,6 +395,8 @@ class MainController extends Component {
|
||||||
storeFocusObjects.setEditFormulaMode(isFormula);
|
storeFocusObjects.setEditFormulaMode(isFormula);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storeFocusObjects.setFunctionsDisabled(state === Asc.c_oAscCellEditorState.editText);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,9 @@ export class storeFocusObjects {
|
||||||
editFormulaMode: observable,
|
editFormulaMode: observable,
|
||||||
setEditFormulaMode: action,
|
setEditFormulaMode: action,
|
||||||
isEditCell: observable,
|
isEditCell: observable,
|
||||||
setEditCell: action
|
setEditCell: action,
|
||||||
|
functionsDisable: observable,
|
||||||
|
setFunctionsDisabled: action,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,4 +124,10 @@ export class storeFocusObjects {
|
||||||
this.isEditCell = value;
|
this.isEditCell = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
functionsDisable = false;
|
||||||
|
|
||||||
|
setFunctionsDisabled(value) {
|
||||||
|
this.functionsDisable = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -87,6 +87,7 @@ const CellEditorView = props => {
|
||||||
const isPhone = Device.isPhone;
|
const isPhone = Device.isPhone;
|
||||||
const storeAppOptions = props.storeAppOptions;
|
const storeAppOptions = props.storeAppOptions;
|
||||||
const storeFunctions = props.storeFunctions;
|
const storeFunctions = props.storeFunctions;
|
||||||
|
const {functionsDisable} = props.storeFocusObjects;
|
||||||
const functions = storeFunctions.functions;
|
const functions = storeFunctions.functions;
|
||||||
const isEdit = storeAppOptions.isEdit;
|
const isEdit = storeAppOptions.isEdit;
|
||||||
const funcArr = props.funcArr;
|
const funcArr = props.funcArr;
|
||||||
|
@ -100,7 +101,7 @@ const CellEditorView = props => {
|
||||||
<View id="idx-celleditor" style={viewStyle} routes={routes} className={expanded ? 'cell-editor expanded' : 'cell-editor collapsed'}>
|
<View id="idx-celleditor" style={viewStyle} routes={routes} className={expanded ? 'cell-editor expanded' : 'cell-editor collapsed'}>
|
||||||
<div id="box-cell-name" className="ce-group">
|
<div id="box-cell-name" className="ce-group">
|
||||||
<span id="idx-cell-name">{props.cellName}</span>
|
<span id="idx-cell-name">{props.cellName}</span>
|
||||||
<a href="#" id="idx-btn-function" className='link icon-only' disabled={(!isEdit && true) || props.stateCoauth} onClick={() => {props.onClickToOpenAddOptions('function', '#idx-btn-function');}}>
|
<a href="#" id="idx-btn-function" className='link icon-only' disabled={(!isEdit && true) || props.stateFunctions || functionsDisable} onClick={() => {props.onClickToOpenAddOptions('function', '#idx-btn-function');}}>
|
||||||
<i className="icon icon-function" />
|
<i className="icon icon-function" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -154,4 +155,4 @@ const routes = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
export default inject("storeAppOptions", "storeFunctions")(observer(CellEditorView));
|
export default inject("storeAppOptions", "storeFunctions", "storeFocusObjects")(observer(CellEditorView));
|
||||||
|
|
Loading…
Reference in a new issue