refactor(frontend): replace toast system with zibll notyf
This commit is contained in:
1 parent
fb11a7ed0c
commit
86614c4905
33 files changed
+603
-802
No files matched your search
@@ -22,16 +22,6 @@
|
||||
return d.restNonce || d.nonce || '';
|
||||
}
|
||||
|
||||
function notify(msg, type) {
|
||||
if (window.aksrt && typeof window.aksrt.toast === 'function') {
|
||||
window.aksrt.toast(msg, type || 'info');
|
||||
return;
|
||||
}
|
||||
if (window.notyf) {
|
||||
try { window.notyf[type === 'error' ? 'error' : 'success'](msg); } catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
function setActionText(text) {
|
||||
var el = document.querySelector('#' + respondId + ' .action-text');
|
||||
if (!el) return;
|
||||
@@ -147,7 +137,7 @@
|
||||
if (submit) submit.disabled = false;
|
||||
})
|
||||
.catch(function () {
|
||||
notify('加载评论失败', 'error');
|
||||
notyf('加载评论失败', 'danger');
|
||||
if (textarea) {
|
||||
textarea.disabled = false;
|
||||
textarea.value = '';
|
||||
|
||||
Reference in new issue
Block a user