connors / photon

The fastest way to build beautiful Electron apps using simple HTML and CSS
photonkit.com
MIT License
10.01k stars 580 forks source link

Component - alert & confirm dialog #42

Open luin opened 8 years ago

luin commented 8 years ago

In OS X, the modal dialog shows below the title bar: image image

Electron does a good job that shows alert and confirm dialog (by invoke alert() and confirm()) following the native style. However when using the custom title bar component of photon, the native dialog will become very strange:

image

I think it would be of great help if photon can offer a dialog component :laughing:

developit commented 8 years ago

@luin This could totally work with the HTML5 <dialog> element proposal I made in #8 / #34.

Here's a working JSFiddle with the small customization needed: jsfiddle.net/developit/636kfvv5

Preview:

preview

Note that the grey backdrop is optional. It is not used if you call <dialog>.show() instead of <dialog>.showModal().