2
0
mirror of https://github.com/tenrok/vue-native-notification.git synced 2026-05-17 04:59:37 +03:00

Custom events fixed

Custom events fixed
This commit is contained in:
David Mañanes
2018-08-07 16:38:33 +02:00
parent 3251f4b2e5
commit 889a2a7dc9
+8 -8
View File
@@ -45,10 +45,10 @@ const VueNativeNotification = {
// Show function
var show = function (title, opts, e) {
e.onerror = function () { }
e.onclick = function () { }
e.onclose = function () { }
e.onshow = function () { }
if (!e.onerror) e.onerror = function () { }
if (!e.onclick) e.onclick = function () { }
if (!e.onclose) e.onclose = function () { }
if (!e.onshow) e.onshow = function () { }
return Promise.resolve()
.then(function () {
if (options.requestOnNotify && Notification.permission !== 'granted') {
@@ -68,25 +68,25 @@ const VueNativeNotification = {
const bindOnError = function (event) {
'use strict'
defaultEvents.onerror(event)
onerror()
e.onerror(event)
}
const bindOnClick = function (event) {
'use strict'
defaultEvents.onclick(event)
onclick()
e.onclick(event)
}
const bindOnClose = function (event) {
'use strict'
defaultEvents.onclose(event)
onclose()
e.onclose(event)
}
const bindOnShow = function (event) {
'use strict'
defaultEvents.onshow(event)
onshow()
e.onshow(event)
}
// Create Notification object