add support for special links in modal content to trigger modal events

(cherry picked from commit 98ca0b318f12e6c15ee53adcfa2121c328536e40)
If event listener is a promise then add its result to arguments that are passed to consecutive listeners

(cherry picked from commit c06ffa603c2ae853cf915fb2c040b006d1f46e7b)