|
|
@@ -7,6 +7,11 @@ import ToolboxItem from './ToolboxItem';
|
|
7
|
7
|
|
|
8
|
8
|
export type Props = {
|
|
9
|
9
|
|
|
|
10
|
+ /**
|
|
|
11
|
+ * Function to be called after the click handler has been processed.
|
|
|
12
|
+ */
|
|
|
13
|
+ afterClick: ?Function,
|
|
|
14
|
+
|
|
10
|
15
|
/**
|
|
11
|
16
|
* Whether to show the label or not.
|
|
12
|
17
|
*/
|
|
|
@@ -38,6 +43,7 @@ export type Props = {
|
|
38
|
43
|
*/
|
|
39
|
44
|
export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
|
|
40
|
45
|
static defaultProps = {
|
|
|
46
|
+ afterClick: undefined,
|
|
41
|
47
|
showLabel: false,
|
|
42
|
48
|
styles: undefined,
|
|
43
|
49
|
toggledStyles: undefined,
|
|
|
@@ -165,7 +171,10 @@ export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
|
|
165
|
171
|
* @returns {void}
|
|
166
|
172
|
*/
|
|
167
|
173
|
_onClick() {
|
|
|
174
|
+ const { afterClick } = this.props;
|
|
|
175
|
+
|
|
168
|
176
|
this._handleClick();
|
|
|
177
|
+ afterClick && afterClick();
|
|
169
|
178
|
}
|
|
170
|
179
|
|
|
171
|
180
|
/**
|