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-pagination-bullet-active{
|
||||
background: @black;
|
||||
.swiper-container {
|
||||
height: 100%;
|
||||
.swiper-pagination-bullet-active{
|
||||
background: @black;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -184,12 +184,12 @@ const PageReplace = props => {
|
|||
</Navbar>
|
||||
<List>
|
||||
<ListItem title={_t.textPictureFromLibrary} onClick={() => {props.onReplaceByFile()}}>
|
||||
<Icon slot="media" icon="icon-link"></Icon>
|
||||
<Icon slot="media" icon="icon-image-library"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textPictureFromURL} link='/edit-image-link/' routeProps={{
|
||||
onReplaceByUrl: props.onReplaceByUrl
|
||||
}}>
|
||||
<Icon slot="media" icon="icon-image-library"></Icon>
|
||||
<Icon slot="media" icon="icon-link"></Icon>
|
||||
</ListItem>
|
||||
</List>
|
||||
</Page>
|
||||
|
|
|
@ -372,7 +372,7 @@
|
|||
"textTopLeft": "Top-Left",
|
||||
"textTopRight": "Top-Right",
|
||||
"textTotalRow": "Total Row",
|
||||
"textTransition": "Transition",
|
||||
"textTransitions": "Transitions",
|
||||
"textType": "Type",
|
||||
"textUnCover": "UnCover",
|
||||
"textVerticalIn": "Vertical In",
|
||||
|
|
|
@ -34,7 +34,7 @@ const ToolbarView = props => {
|
|||
onEditClick: () => props.openOptions('edit'),
|
||||
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}
|
||||
<Link className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={() => props.openOptions('settings')}></Link>
|
||||
</NavRight>
|
||||
|
|
|
@ -149,12 +149,12 @@ const PageReplace = props => {
|
|||
</Navbar>
|
||||
<List>
|
||||
<ListItem title={_t.textPictureFromLibrary} onClick={() => {props.onReplaceByFile()}}>
|
||||
<Icon slot="media" icon="icon-link"></Icon>
|
||||
<Icon slot="media" icon="icon-image-library"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textPictureFromURL} link='/edit-image-link/' routeProps={{
|
||||
onReplaceByUrl: props.onReplaceByUrl
|
||||
}}>
|
||||
<Icon slot="media" icon="icon-image-library"></Icon>
|
||||
<Icon slot="media" icon="icon-link"></Icon>
|
||||
</ListItem>
|
||||
</List>
|
||||
</Page>
|
||||
|
|
|
@ -19,7 +19,7 @@ const EditSlide = props => {
|
|||
<ListItem title={_t.textLayout} link="/layout/" routeProps={{
|
||||
onLayoutClick: props.onLayoutClick
|
||||
}}></ListItem>
|
||||
<ListItem title={_t.textTransition} link="/transition/" routeProps={{
|
||||
<ListItem title={t('View.Edit.textTransitions')} link="/transition/" routeProps={{
|
||||
onEffectClick: props.onEffectClick,
|
||||
onEffectTypeClick: props.onEffectTypeClick,
|
||||
changeDuration: props.changeDuration,
|
||||
|
@ -225,7 +225,7 @@ const PageTransition = props => {
|
|||
|
||||
return (
|
||||
<Page className="slide-transition">
|
||||
<Navbar title={_t.textTransition} backLink={_t.textBack}>
|
||||
<Navbar title={t('View.Edit.textTransitions')} backLink={_t.textBack}>
|
||||
{Device.phone &&
|
||||
<NavRight>
|
||||
<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 = t('View.Settings', {returnObjects: true});
|
||||
const storeToolbarSettings = props.storeToolbarSettings;
|
||||
const disabledPreview = storeToolbarSettings.countPages <= 0;
|
||||
|
||||
const navbar = <Navbar title={_t.textSettings}>
|
||||
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
|
||||
</Navbar>;
|
||||
|
@ -121,7 +124,7 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
|||
{navbar}
|
||||
<List>
|
||||
{!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>
|
||||
</ListItem>
|
||||
}
|
||||
|
@ -141,7 +144,7 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
|||
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}>
|
||||
<Icon slot="media" icon="icon-download"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textPrint} onClick={onPrint}>
|
||||
<ListItem className={disabledPreview && 'disabled'} title={_t.textPrint} onClick={onPrint}>
|
||||
<Icon slot="media" icon="icon-print"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textPresentationInfo} link="#" onClick={onoptionclick.bind(this, "/presentation-info/")}>
|
||||
|
|
|
@ -14,7 +14,7 @@ const CellEditor = props => {
|
|||
}, []);
|
||||
|
||||
const [cellName, setCellName] = useState('');
|
||||
const [stateCoauth, setCoauthDisabled] = useState(null);
|
||||
const [stateFunctions, setFunctionshDisabled] = useState(null);
|
||||
const [stateFuncArr, setFuncArr] = useState('');
|
||||
|
||||
const onApiCellSelection = info => {
|
||||
|
@ -22,7 +22,17 @@ const CellEditor = props => {
|
|||
};
|
||||
|
||||
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 => {
|
||||
|
@ -43,7 +53,7 @@ const CellEditor = props => {
|
|||
return (
|
||||
<CellEditorView
|
||||
cellName={cellName}
|
||||
stateCoauth={stateCoauth}
|
||||
stateFunctions={stateFunctions}
|
||||
onClickToOpenAddOptions={props.onClickToOpenAddOptions}
|
||||
funcArr={stateFuncArr}
|
||||
insertFormula={insertFormula}
|
||||
|
|
|
@ -395,6 +395,8 @@ class MainController extends Component {
|
|||
storeFocusObjects.setEditFormulaMode(isFormula);
|
||||
}
|
||||
}
|
||||
|
||||
storeFocusObjects.setFunctionsDisabled(state === Asc.c_oAscCellEditorState.editText);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,9 @@ export class storeFocusObjects {
|
|||
editFormulaMode: observable,
|
||||
setEditFormulaMode: action,
|
||||
isEditCell: observable,
|
||||
setEditCell: action
|
||||
setEditCell: action,
|
||||
functionsDisable: observable,
|
||||
setFunctionsDisabled: action,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -122,4 +124,10 @@ export class storeFocusObjects {
|
|||
this.isEditCell = value;
|
||||
}
|
||||
|
||||
functionsDisable = false;
|
||||
|
||||
setFunctionsDisabled(value) {
|
||||
this.functionsDisable = value;
|
||||
}
|
||||
|
||||
}
|
|
@ -87,6 +87,7 @@ const CellEditorView = props => {
|
|||
const isPhone = Device.isPhone;
|
||||
const storeAppOptions = props.storeAppOptions;
|
||||
const storeFunctions = props.storeFunctions;
|
||||
const {functionsDisable} = props.storeFocusObjects;
|
||||
const functions = storeFunctions.functions;
|
||||
const isEdit = storeAppOptions.isEdit;
|
||||
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'}>
|
||||
<div id="box-cell-name" className="ce-group">
|
||||
<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" />
|
||||
</a>
|
||||
</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