Merge pull request #1048 from ONLYOFFICE/feature/fix-bug-reactjs
Feature/fix bug reactjs
This commit is contained in:
commit
9ea8dc50b4
|
@ -39,8 +39,8 @@ class ApplicationSettingsController extends Component {
|
||||||
this.props.storeAppOptions.changeCanViewComments(value);
|
this.props.storeAppOptions.changeCanViewComments(value);
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
api.asc_hideComments();
|
|
||||||
this.switchDisplayResolved(value);
|
this.switchDisplayResolved(value);
|
||||||
|
api.asc_hideComments();
|
||||||
LocalStorage.setBool("de-settings-resolvedcomment", false);
|
LocalStorage.setBool("de-settings-resolvedcomment", false);
|
||||||
} else {
|
} else {
|
||||||
const resolved = LocalStorage.getBool("de-settings-resolvedcomment");
|
const resolved = LocalStorage.getBool("de-settings-resolvedcomment");
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {Device} from '../../../../../common/mobile/utils/device';
|
||||||
|
|
||||||
const AddSlide = props => {
|
const AddSlide = props => {
|
||||||
const layouts = props.storeSlideSettings.slideLayouts;
|
const layouts = props.storeSlideSettings.slideLayouts;
|
||||||
|
const [stateDisabled, setDisabled] = useState(false);
|
||||||
return (
|
return (
|
||||||
<div className={'dataview slide-layout'}>
|
<div className={'dataview slide-layout'}>
|
||||||
{layouts.map((row, rowIndex) => {
|
{layouts.map((row, rowIndex) => {
|
||||||
|
@ -13,7 +14,8 @@ const AddSlide = props => {
|
||||||
<ul key={`row-${rowIndex}`} className={'row'}>
|
<ul key={`row-${rowIndex}`} className={'row'}>
|
||||||
{row.map((layout, index) => {
|
{row.map((layout, index) => {
|
||||||
return (
|
return (
|
||||||
<li key={`item-${rowIndex}-${index}`} onClick={() => {props.onSlideLayout(layout.type)}}>
|
<li className = {stateDisabled ? 'disabled' : ''} key={`item-${rowIndex}-${index}`}
|
||||||
|
onClick={() => {props.onSlideLayout(layout.type); setDisabled(true)}}>
|
||||||
<img src={layout.image} width={layout.width} height={layout.height}/>
|
<img src={layout.image} width={layout.width} height={layout.height}/>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,16 +6,23 @@ const CellEditor = props => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Common.Notifications.on('engineCreated', api => {
|
Common.Notifications.on('engineCreated', api => {
|
||||||
api.asc_registerCallback('asc_onSelectionNameChanged', onApiCellSelection.bind(this));
|
api.asc_registerCallback('asc_onSelectionNameChanged', onApiCellSelection.bind(this));
|
||||||
|
api.asc_registerCallback('asc_onSelectionChanged', onApiSelectionChanged.bind(this));
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const [cellName, setCellName] = useState('');
|
const [cellName, setCellName] = useState('');
|
||||||
|
const [stateCoauth, setCoauthDisabled] = useState(null);
|
||||||
|
|
||||||
const onApiCellSelection = info => {
|
const onApiCellSelection = info => {
|
||||||
setCellName(typeof(info)=='string' ? info : info.asc_getName());
|
setCellName(typeof(info)=='string' ? info : info.asc_getName());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onApiSelectionChanged = info => {
|
||||||
|
setCoauthDisabled(info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true);
|
||||||
|
}
|
||||||
|
|
||||||
return <CellEditorView cellName={cellName}
|
return <CellEditorView cellName={cellName}
|
||||||
|
stateCoauth = {stateCoauth}
|
||||||
onClickToOpenAddOptions={props.onClickToOpenAddOptions}/>
|
onClickToOpenAddOptions={props.onClickToOpenAddOptions}/>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ const CellEditorView = props => {
|
||||||
return <View id="idx-celleditor" style={viewStyle} className={expanded?'expanded':'collapsed'}>
|
return <View id="idx-celleditor" style={viewStyle} className={expanded?'expanded':'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} onClick={() => {props.onClickToOpenAddOptions('function', '#idx-btn-function');}}>
|
<a href="#" id="idx-btn-function" className='link icon-only' disabled={(!isEdit && true) || props.stateCoauth} onClick={() => {props.onClickToOpenAddOptions('function', '#idx-btn-function');}}>
|
||||||
<i className="icon icon-function" />
|
<i className="icon icon-function" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue