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);
|
||||
|
||||
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");
|
||||
|
|
|
@ -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>
|
||||
)
|
||||
|
|
|
@ -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}/>
|
||||
};
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue