What event fires when I click on an external document?
3 answers
As of Polymer 1.0, you can do the following:
<paper-dialog id="loginDialog">
...
</paper-dialog>
var dialog = document.getElementById('loginDialog');
dialog.addEventListener('iron-overlay-closed', function (customEvent) {
var id = customEvent.currentTarget.id;
console.log(id + " is closed!");
});
customEvent
has many different properties that allow you to see which dialogue you are starting with. The above example looks at the value of the Id
field currentTarget
.
In paper-dialog-behaviors.html
we can see that the following events can be listened to:
listeners: {
'click': '_onDialogClick',
'iron-overlay-opened': '_onIronOverlayOpened',
'iron-overlay-closed': '_onIronOverlayClosed'
},
+2
source to share