feat(toolbar-button-clicked) Enhance toolbar buttons with notify click

- add possibility to allow execution of the button's routine besides triggering
`toolbarButtonClicked` API event
- keep backwards compatibility
- get rid of `ToolbarButton`
This commit is contained in:
Horatiu Muresan
2022-01-04 13:21:00 +02:00
committed by GitHub
parent 847dc2a7bb
commit 197dbfbbcb
48 changed files with 459 additions and 524 deletions

View File

@@ -9,7 +9,6 @@ import { connect } from '../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
import { toggleDocument } from '../../etherpad/actions';
type Props = AbstractButtonProps & {
/**
@@ -59,13 +58,7 @@ class SharedDocumentButton extends AbstractButton<Props, *> {
* @returns {void}
*/
_handleClick() {
const { _editing, dispatch, handleClick } = this.props;
if (handleClick) {
handleClick();
return;
}
const { _editing, dispatch } = this.props;
sendAnalytics(createToolbarEvent(
'toggle.etherpad',