Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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