diff --git a/packages/notification/src/index.js b/packages/notification/src/index.js index d1562574607e23688dbd393b0dd84ffdaad3f69a..bcee6d6864eeb2fe4113eb47aa6837baed29e443 100644 --- a/packages/notification/src/index.js +++ b/packages/notification/src/index.js @@ -1,4 +1,4 @@ import './vpu-notification'; -import { send } from './notification'; +import { send } from 'vpu-common/notification'; export { send }; diff --git a/packages/notification/src/notification.js b/packages/notification/src/notification.js deleted file mode 100644 index ac18c03014027b4dc49a423431bb25a0cd4a51ea..0000000000000000000000000000000000000000 --- a/packages/notification/src/notification.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Sends a notification via the event - * - * example options: - * - * { - * "summary": "Item deleted", - * "body": "Item foo was deleted!", - * "type": "info", - * "timeout": 5, - * } - * - * @param options - */ -function send(options) { - const event = new CustomEvent("vpu-notification-send", { - bubbles: true, - cancelable: true, - detail: options, - }); - - window.dispatchEvent(event); -} - -export { send }; diff --git a/packages/notification/src/vpu-notification-demo.js b/packages/notification/src/vpu-notification-demo.js index 31c4c0d3650640a55d0aae667c7d3034e01236f5..113b63ed8ed73183ba0925b96ae15e943b40e65e 100644 --- a/packages/notification/src/vpu-notification-demo.js +++ b/packages/notification/src/vpu-notification-demo.js @@ -1,5 +1,5 @@ import {i18n} from './i18n'; -import {send as notify} from './notification'; +import {send as notify} from 'vpu-common/notification'; import {html, LitElement} from 'lit-element'; import './vpu-notification'; import commonUtils from 'vpu-common/utils'; diff --git a/packages/notification/src/vpu-notification.js b/packages/notification/src/vpu-notification.js index e95fe4c97ad2b978b44e111a4bead3971313e433..14db62452cf7ee3dfd2a1589e03cd2b8f8dd8174 100644 --- a/packages/notification/src/vpu-notification.js +++ b/packages/notification/src/vpu-notification.js @@ -56,6 +56,9 @@ class VPUNotification extends VPULitElement { that.removeMessageId(messageId); }, timeout * 1000); } + + // mark the event as handled + e.preventDefault(); }); this.updateComplete.then(()=>{ diff --git a/packages/notification/vendor/common b/packages/notification/vendor/common index 68e0a4f1f1a3ef6e05aca5216bf8684578ec2229..3623e0d1d062c1048ee37ac779d9425b56ffe26b 160000 --- a/packages/notification/vendor/common +++ b/packages/notification/vendor/common @@ -1 +1 @@ -Subproject commit 68e0a4f1f1a3ef6e05aca5216bf8684578ec2229 +Subproject commit 3623e0d1d062c1048ee37ac779d9425b56ffe26b