docs: add notification examples (#20528)

Refs #20442

Adds the basic notification and notification with custom image examples from electron-api-demos into runnable Fiddle examples.

Gist links to Fiddles (same as code submitted in this PR):
Basic Notification: https://gist.github.com/102945f83f559e7944797175d8fd8af4
Notification with image: https://gist.github.com/2688bf4bfc27ce02f5d74224828eb928

Co-Authored-By: Erick Zhao <erick@hotmail.ca>
This commit is contained in:
Harendra Singh 2019-10-16 02:36:58 +05:30 committed by Shelley Vohr
parent 16d4ace800
commit 93788e76e0
6 changed files with 122 additions and 0 deletions

View file

@ -0,0 +1,14 @@
const notification = {
title: 'Basic Notification',
body: 'Short message part'
}
const notificationButton = document.getElementById('basic-noti')
notificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(notification.title, notification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})