How to use the uikit.modal function in uikit

To help you get started, we’ve selected a few uikit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuikit / vuikit / src / lib / ModalBase.vue View on Github external
initModal: function () {
      var vm = this
      this.UImodal = UI.modal(this.$els.modal, this.options)
      this.UImodal.on('show.uk.modal', () => {
        vm.show = true
        vm.$emit('show')
        setTimeout(function () {
          // catch .uk-overflow-container
          vm.UImodal.resize()
        }, 1)
      })
      this.UImodal.on('hide.uk.modal', () => {
        vm.show = false
        vm.$emit('hide')
      })
    }
  }
github unite-cms / unite-cms / src / Bundle / AdminBundle / Resources / assets / vue / components / Modal.vue View on Github external
mounted() {
            UIkit.modal(this.$refs.modal).show();
            UIkit.util.on(this.$refs.modal, 'hide', (e) => {
                if(e.target === this.$refs.modal) {
                    this.$emit('hide');
                }
            });
        },
        beforeDestroy() {
github ericflo / mediasummon / admin / components / AddTargetModal.js View on Github external
useEffect(() => {
    const showing = selfVal && enabled;
    var modal = null;
    if (selfVal) {
      modal = require('uikit').modal(selfVal);
      selfVal.addEventListener('hidden', closeListener);
    }
    if (modal && showing) {
      modal.show();
    }
    return () => {
      if (modal && showing) {
        modal.hide();
      }
    };
  }, [selfVal, enabled]);
  useEffect(() => {
github polonel / trudesk / src / client / reducers / shared / modalReducer.js View on Github external
[HIDE_MODAL]: (state, action) => {
      const modal = document.getElementById('uk-modal')
      if (modal) {
        const modalTag = modal.getAttribute('data-modal-tag')
        if (modalTag === action.payload) UIKit.modal(modal).hide()
        else if (!modalTag) UIKit.modal(modal).hide()
      }
      return state
    },
github polonel / trudesk / src / client / containers / Modals / BaseModal.jsx View on Github external
componentDidMount () {
    this.setState(
      {
        modal: UIKit.modal(this.modal, this.props.options)
      },
      () => {
        this.state.modal.show()
        $(this.modal).on('hide.uk.modal', this.clearModal)
      }
    )
  }
github unite-cms / unite-cms / src / Bundle / AdminBundle / Resources / assets / vue / components / Modal.vue View on Github external
beforeDestroy() {
            let modal = this.$refs.modal;
            UIkit.modal(modal).hide().finally(() => {
                modal.remove();
            });
        }
    }