[SSE] Fix Bug 51707
This commit is contained in:
parent
74a0573c2a
commit
b16e82ea2e
|
@ -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