meteoric / meteor-ionic

Ionic components for Meteor. No Angular!
http://meteoric.github.io
MIT License
1.51k stars 219 forks source link

IonPopup - add cssClass, IonPopup.show etc now returns a handle to close individual popups, scope bug with multiple popups fixed #351

Open ClarenceL opened 8 years ago

ClarenceL commented 8 years ago

This should allow using multiple nested popups, e.g.

IonPopup.show({
      title: 'Forgotten Password'
      template: "..."
      # example of cssClass usage
      cssClass: 'popup-wide popup-forgot-password'
      buttons: [{
        text: 'Cancel'
        type: 'button-default'
        onTap: ( ev, t) ->
          return true;
      },
      {
        text: 'Submit'
        type: 'button-positive'
        onTap: ( ev, t ) ->

          resetEmail = $('#forgot_password_container .forgotten-password-email').val()
          resetEmail = resetEmail.replace(/[ ]/g, '').toLowerCase()

          unless resetEmail?.length
            # example of support for closing of individual popups
            subNoEmailPopup = IonPopup.show(
              template: 'You must enter an email'
              buttons: [{
                text: 'Ok'
                type: 'button-default'
                onTap: ( ev, t ) ->
                  subNoEmailPopup.close()
              }]
            )