What event fires when I click on an external document?

I want to catch a paper-box dialog event.

Is there any event that fires when the dialog is displayed / outside?

+1


source to share


3 answers


You can try core-overlay-close-completed

.



See jsbin .

+1


source


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


I tried another (after @justin's suggestion) approach to trigger:

  observe: {
    '$.dialog.opened': 'dialogChanged'
  },
  dialogChanged: function (old, new) {
    console.log(new);
  },

      

I see an attribute opened

with a dialog and it changed based on the state of the dialog.

+1


source







All Articles