Merge pull request #1048 from ONLYOFFICE/feature/fix-bug-reactjs

Feature/fix bug reactjs
This commit is contained in:
Julia Radzhabova 2021-08-09 10:52:26 +03:00 committed by GitHub
commit 9ea8dc50b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 3 deletions

View file

@ -39,8 +39,8 @@ class ApplicationSettingsController extends Component {
this.props.storeAppOptions.changeCanViewComments(value);
if (!value) {
api.asc_hideComments();
this.switchDisplayResolved(value);
api.asc_hideComments();
LocalStorage.setBool("de-settings-resolvedcomment", false);
} else {
const resolved = LocalStorage.getBool("de-settings-resolvedcomment");

View file

@ -6,6 +6,7 @@ import {Device} from '../../../../../common/mobile/utils/device';
const AddSlide = props => {
const layouts = props.storeSlideSettings.slideLayouts;
const [stateDisabled, setDisabled] = useState(false);
return (
<div className={'dataview slide-layout'}>
{layouts.map((row, rowIndex) => {
@ -13,7 +14,8 @@ const AddSlide = props => {
<ul key={`row-${rowIndex}`} className={'row'}>
{row.map((layout, index) => {
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}/>
</li>
)

View file

@ -6,16 +6,23 @@ const CellEditor = props => {
useEffect(() => {
Common.Notifications.on('engineCreated', api => {
api.asc_registerCallback('asc_onSelectionNameChanged', onApiCellSelection.bind(this));
api.asc_registerCallback('asc_onSelectionChanged', onApiSelectionChanged.bind(this));
});
}, []);
const [cellName, setCellName] = useState('');
const [stateCoauth, setCoauthDisabled] = useState(null);
const onApiCellSelection = info => {
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}
stateCoauth = {stateCoauth}
onClickToOpenAddOptions={props.onClickToOpenAddOptions}/>
};

View file

@ -23,7 +23,7 @@ const CellEditorView = props => {
return <View id="idx-celleditor" style={viewStyle} className={expanded?'expanded':'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} 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" />
</a>
</div>