Skip to content

Conversation

@ClarenceL
Copy link

  • IonicPopup - add cssClass option which is supported in official Ionic Framework
  • IonicPopup - return a handle with a close function, to allow closing individual IonPopups, this is also expected functionality in Ionic Framework
  • IonicPopup - closing of individual popups, highlighted other bugs, fixed a bug I found on IonPopup.buttonClicked, this is the .call in the buttonClicked, not referencing the correct popup in cases where there are multiple popups. This is reproducible if you first show a two button popup, then within the onTap, you were to show a second single button popup. After you close the "second" single button popup, in the onTap, of the first popup, this still references the second popup.

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()
              }]
            )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant