question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor JavaScript dialogs API

See original GitHub issue

The phantom’s approach to handling javascript dialogs is convenient and familiar: instead of firing Alert, Prompt and Confirm events, we should use onAlert, onPrompt and onConfirm callbacks. It would be also convenient to have a complimentary Dialog event which dispatches dialog class.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ebidelcommented, Jun 15, 2017

I like it.

1reaction
dgozmancommented, Jun 15, 2017

I think onFoo is a nice way to subscribe to events. We use it in our testing harnesses a lot.

page.onAlert(message => {
  console.log(message);
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Refactor to use Drupal.dialog ? [#2998156] | Drupal.org
Any plan to use core Dialog API (? I started overriding the Javascript to use the native Drupal.dialog. I was wondering if you...
Read more >
Dialog API - Frappe Framework
Frappe provides a group of standard, interactive and flexible dialogs that are easy to configure and use. There's also a more extensive API...
Read more >
Building a dialog component - web.dev
A foundational overview of how to build color-adaptive, responsive, and accessible mini and mega modals with the element.
Read more >
APIs for custom dialogs | TinyMCE Documentation
APIs for custom TinyMCE dialogs. ... The instance API is a JavaScript object containing methods attached to the dialog instance. When the dialog...
Read more >
How to create a dialog with “Ok” and “Cancel” options
Once the user clicks on the button, I want a JavaScript alert to offer “yes” and “cancel” options. If the user selects “yes”,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found