[mobile] refactoring

This commit is contained in:
Maxim Kadushkin 2021-09-23 12:19:24 +03:00
parent 751fedc663
commit 9472f77ef0
2 changed files with 12 additions and 8 deletions

View file

@ -206,11 +206,13 @@ class ContextMenuController extends Component {
Common.Notifications.off('document:ready', this.onDocumentReady);
const api = Common.EditorApi.get();
if ( api ) {
api.asc_unregisterCallback('asc_onShowPopMenu', this.onApiOpenContextMenu);
api.asc_unregisterCallback('asc_onHidePopMenu', this.onApiHideContextMenu);
api.asc_unregisterCallback('asc_onShowForeignCursorLabel', this.onApiShowForeignCursorLabel);
api.asc_unregisterCallback('asc_onHideForeignCursorLabel', this.onApiHideForeignCursorLabel);
}
}
componentDidMount() {
if ( !Common.EditorApi ) {

View file

@ -31,10 +31,12 @@ const PluginsController = inject('storeAppOptions')(observer(props => {
return () => {
const api = Common.EditorApi.get();
if ( api ) {
api.asc_unregisterCallback("asc_onPluginShow", showPluginModal);
api.asc_unregisterCallback("asc_onPluginClose", pluginClose);
api.asc_unregisterCallback("asc_onPluginResize", pluginResize);
api.asc_unregisterCallback('asc_onPluginsInit', onPluginsInit);
}
};
});