Ad

How Do I Execute A Function On-close Or On Dismiss Of For Polymer 1.0?

Question:

How do I automatically execute a function whenever my <paper-dialog> element is closed?

Version: Polymer 1.0

Code:

<paper-dialog id="paper-id"
              entry-animation="scale-up-animation"
              exit-animation="scale-down-animation">
    <sample-element></sample-element>
</paper-dialog>
Ad

Answer

paper-dialog inherits the Polymer.IronOverlayBehavior, which has the iron-overlay-opened and iron-overlay-closed events.

<paper-dialog
  on-iron-overlay-opened="_myOpenFunction"
  on-iron-overlay-closed="_myClosedFunction"></paper-dialog>
Ad
source: stackoverflow.com
Ad