소스 검색

feat(toolbox): add ability to run a handler after click to AbstractButton

master
Saúl Ibarra Corretgé 7 년 전
부모
커밋
99b5a41269
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9
    0
      react/features/base/toolbox/components/AbstractButton.js

+ 9
- 0
react/features/base/toolbox/components/AbstractButton.js 파일 보기

7
 
7
 
8
 export type Props = {
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
      * Whether to show the label or not.
16
      * Whether to show the label or not.
12
      */
17
      */
38
  */
43
  */
39
 export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
44
 export default class AbstractButton<P: Props, S: *> extends Component<P, S> {
40
     static defaultProps = {
45
     static defaultProps = {
46
+        afterClick: undefined,
41
         showLabel: false,
47
         showLabel: false,
42
         styles: undefined,
48
         styles: undefined,
43
         toggledStyles: undefined,
49
         toggledStyles: undefined,
165
      * @returns {void}
171
      * @returns {void}
166
      */
172
      */
167
     _onClick() {
173
     _onClick() {
174
+        const { afterClick } = this.props;
175
+
168
         this._handleClick();
176
         this._handleClick();
177
+        afterClick && afterClick();
169
     }
178
     }
170
 
179
 
171
     /**
180
     /**

Loading…
취소
저장