mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
update notification generator
This commit is contained in:
1 parent
900e19382b
commit
95bfd98b43
1 file changed
+2
-3
@@ -22,7 +22,7 @@ export default class Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static show({
|
static show({
|
||||||
avatar, title, message, type = 'info', duration = 3000,
|
avatar, title, message, type, duration = 3000,
|
||||||
actionButtons = [],
|
actionButtons = [],
|
||||||
}) {
|
}) {
|
||||||
if (duration && lastNotification) {
|
if (duration && lastNotification) {
|
||||||
@@ -33,9 +33,8 @@ export default class Notification {
|
|||||||
if (title) $(tpl`${title} `).appendTo($dom);
|
if (title) $(tpl`${title} `).appendTo($dom);
|
||||||
$(tpl`${message}`).appendTo($dom);
|
$(tpl`${message}`).appendTo($dom);
|
||||||
actionButtons.forEach((button) => {
|
actionButtons.forEach((button) => {
|
||||||
$(tpl`<button class="${button.class}">${button.name}</button>`).appendTo($dom);
|
$(tpl`<button class="${button.class}" onclick="javascript:window.${button.funcName}();">${button.name}</button>`).appendTo($dom);
|
||||||
});
|
});
|
||||||
console.log($dom);
|
|
||||||
const $n = $dom
|
const $n = $dom
|
||||||
.css('z-index', zIndexManager.getNext())
|
.css('z-index', zIndexManager.getNext())
|
||||||
.appendTo('body');
|
.appendTo('body');
|
||||||
|
|||||||
Reference in new issue
Block a user