index.js 649 B

123456789101112131415161718192021
  1. import { Component, triggerEventOnly } from '../_util/simply';
  2. import { ModalFunctionalProps } from './props';
  3. Component(ModalFunctionalProps, {
  4. onClose: function () {
  5. triggerEventOnly(this, 'close');
  6. },
  7. onMaskClose: function () {
  8. if (this.props.maskClosable) {
  9. triggerEventOnly(this, 'close');
  10. }
  11. },
  12. onPrimaryButtonTap: function () {
  13. triggerEventOnly(this, 'primaryButtonTap');
  14. },
  15. onSecondaryButtonTap: function () {
  16. triggerEventOnly(this, 'secondaryButtonTap');
  17. },
  18. onCancelButtonTap: function () {
  19. triggerEventOnly(this, 'cancelButtonTap');
  20. },
  21. });