mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
refactor: use alerts.error/success
This commit is contained in:
@@ -61,7 +61,7 @@ define('forum/topic/threadTools', [
|
||||
.then(function () {
|
||||
eventEl.remove();
|
||||
})
|
||||
.catch(app.alertError);
|
||||
.catch(alerts.error);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -70,7 +70,7 @@ define('forum/topic/threadTools', [
|
||||
topicContainer.on('click', '[component="topic/mark-unread"]', function () {
|
||||
socket.emit('topics.markUnread', tid, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err);
|
||||
return alerts.error(err);
|
||||
}
|
||||
|
||||
if (app.previousUrl && !app.previousUrl.match('^/topic')) {
|
||||
@@ -81,7 +81,7 @@ define('forum/topic/threadTools', [
|
||||
ajaxify.go('category/' + ajaxify.data.category.slug, handleBack.onBackClicked);
|
||||
}
|
||||
|
||||
app.alertSuccess('[[topic:mark_unread.success]]');
|
||||
alerts.success('[[topic:mark_unread.success]]');
|
||||
});
|
||||
return false;
|
||||
});
|
||||
@@ -90,9 +90,9 @@ define('forum/topic/threadTools', [
|
||||
const btn = $(this);
|
||||
socket.emit('topics.markAsUnreadForAll', [tid], function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
return alerts.error(err);
|
||||
}
|
||||
app.alertSuccess('[[topic:markAsUnreadForAll.success]]');
|
||||
alerts.success('[[topic:markAsUnreadForAll.success]]');
|
||||
btn.parents('.thread-tools.open').find('.dropdown-toggle').trigger('click');
|
||||
});
|
||||
return false;
|
||||
@@ -182,7 +182,7 @@ define('forum/topic/threadTools', [
|
||||
|
||||
socket.emit('topics.loadTopicTools', { tid: ajaxify.data.tid, cid: ajaxify.data.cid }, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err);
|
||||
return alerts.error(err);
|
||||
}
|
||||
app.parseAndTranslate('partials/topic/topic-menu-list', data, function (html) {
|
||||
dropdownMenu.html(html);
|
||||
@@ -204,7 +204,7 @@ define('forum/topic/threadTools', [
|
||||
if (ok) {
|
||||
api[method](`/topics/${tid}${path}`, body)
|
||||
.then(onComplete)
|
||||
.catch(app.alertError);
|
||||
.catch(alerts.error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -256,7 +256,7 @@ define('forum/topic/threadTools', [
|
||||
body.expiry = expiry.getTime();
|
||||
onSuccess();
|
||||
} else {
|
||||
app.alertError('[[error:invalid-date]]');
|
||||
alerts.error('[[error:invalid-date]]');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user