mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: contest balloon notice (#1071)
This commit is contained in:
1 parent
6d2442c6a3
commit
053978d9d4
12 files changed
+135
-63
No files matched your search
@@ -38,11 +38,12 @@ export default class Notification {
|
||||
if (avatar) this.type += ' avatar';
|
||||
if (title) this.type += ' title';
|
||||
this.action = action || (() => { });
|
||||
this.$dom = $(tpl`<div class="notification ${type} hide"></div>`);
|
||||
if (avatar) $(tpl`<img width="64" height="64" class="avatar" src="${avatar}"></img>`).appendTo(this.$dom);
|
||||
this.$dom = $(tpl`<div class="notification ${this.type} hide"></div>`);
|
||||
if (avatar) $(tpl`<img width="32" height="32" class="avatar" src="${avatar}"></img>`).appendTo(this.$dom);
|
||||
const content = message.split('\n').map((line) => tpl`<p>${line}</p>`).join('');
|
||||
if (title) {
|
||||
$(tpl`<div class="notification-content"><h2>${title}</h2><p>${message}</p></div>`).appendTo(this.$dom);
|
||||
} else $(tpl`<p>${message}</p>`).appendTo(this.$dom);
|
||||
$(tpl`<div class="notification-content"><h2>${title}</h2>${{ templateRaw: true, html: content }}</div>`).appendTo(this.$dom);
|
||||
} else $(`<div>${content}</div>`).appendTo(this.$dom);
|
||||
this.$dom.on('click', this.handleClick.bind(this));
|
||||
this.$n = this.$dom
|
||||
.css('z-index', zIndexManager.getNext())
|
||||
|
||||
Reference in new issue
Block a user