2
0
mirror of https://github.com/tenrok/vue-native-notification.git synced 2026-06-22 13:50:34 +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 // Show function
var show = function (title, opts, e) { var show = function (title, opts, e) {
e.onerror = function () { } if (!e.onerror) e.onerror = function () { }
e.onclick = function () { } if (!e.onclick) e.onclick = function () { }
e.onclose = function () { } if (!e.onclose) e.onclose = function () { }
e.onshow = function () { } if (!e.onshow) e.onshow = function () { }
return Promise.resolve() return Promise.resolve()
.then(function () { .then(function () {
if (options.requestOnNotify && Notification.permission !== 'granted') { if (options.requestOnNotify && Notification.permission !== 'granted') {
@@ -68,25 +68,25 @@ const VueNativeNotification = {
const bindOnError = function (event) { const bindOnError = function (event) {
'use strict' 'use strict'
defaultEvents.onerror(event) defaultEvents.onerror(event)
onerror() e.onerror(event)
} }
const bindOnClick = function (event) { const bindOnClick = function (event) {
'use strict' 'use strict'
defaultEvents.onclick(event) defaultEvents.onclick(event)
onclick() e.onclick(event)
} }
const bindOnClose = function (event) { const bindOnClose = function (event) {
'use strict' 'use strict'
defaultEvents.onclose(event) defaultEvents.onclose(event)
onclose() e.onclose(event)
} }
const bindOnShow = function (event) { const bindOnShow = function (event) {
'use strict' 'use strict'
defaultEvents.onshow(event) defaultEvents.onshow(event)
onshow() e.onshow(event)
} }
// Create Notification object // Create Notification object