How to block the javascript function till the Paper-Dialog is closed

121 Views Asked by At

When ever the user leaves a page, I try to open a paper-dialog asking for the confirmation.

canLeavePage : function(){ 
this.$.paperDialog.open()
}

where canLeavePage triggers before the page is changed. But canLeavePage doesnt wait until the paperDialog is closed.

Is there anyway where I can wait for the result of the paperDialog in canLeavePage function and then proceed?

0

There are 0 best solutions below