fix: remove success toast on settings.save, navigation, widgets

This commit is contained in:
Julian Lam
2022-10-24 12:26:50 -04:00
parent 539e3cb5a8
commit 556b06ac2d
5 changed files with 16 additions and 25 deletions

View File

@@ -4,8 +4,6 @@
"acp-title": "%1 | NodeBB Admin Control Panel",
"settings-header-contents": "Contents",
"changes-saved": "Changes Saved",
"changes-saved-message": "Your changes to the NodeBB configuration have been saved.",
"changes-not-saved": "Changes Not Saved",
"changes-not-saved-message": "NodeBB encountered a problem saving your changes. (%1)"
}

View File

@@ -127,16 +127,14 @@ define('admin/extend/widgets', [
socket.emit('admin.widgets.set', saveData, function (err) {
if (err) {
alerts.error(err);
return alerts.error(err);
}
alerts.alert({
alert_id: 'admin:widgets',
type: 'success',
title: '[[admin/extend/widgets:alert.updated]]',
message: '[[admin/extend/widgets:alert.update-success]]',
timeout: 2500,
});
const saveBtn = document.getElementById('save');
saveBtn.classList.toggle('saved', true);
setTimeout(() => {
saveBtn.classList.toggle('saved', false);
}, 5000);
});
}

View File

@@ -84,14 +84,6 @@ define('admin/settings', ['uploader', 'mousetrap', 'hooks', 'alerts'], function
saveBtn.get(0).classList.toggle('saved', false);
}, 5000);
alerts.alert({
alert_id: 'config_status',
timeout: 2500,
title: '[[admin/admin:changes-saved]]',
message: '[[admin/admin:changes-saved-message]]',
type: 'success',
});
hooks.fire('action:admin.settingsSaved');
});
});

View File

@@ -145,7 +145,11 @@ define('admin/settings/navigation', [
if (err) {
alerts.error(err);
} else {
alerts.success('Successfully saved navigation');
const saveBtn = document.getElementById('save');
saveBtn.classList.toggle('saved', true);
setTimeout(() => {
saveBtn.classList.toggle('saved', false);
}, 5000);
}
});
}

View File

@@ -550,12 +550,11 @@ define('settings', ['hooks', 'alerts'], function (hooks, alerts) {
timeout: 2500,
});
} else {
alerts.alert({
title: '[[admin/admin:changes-saved]]',
message: '[[admin/admin:changes-saved-message]]',
type: 'success',
timeout: 2500,
});
const saveBtn = document.getElementById('save');
saveBtn.classList.toggle('saved', true);
setTimeout(() => {
saveBtn.classList.toggle('saved', false);
}, 5000);
}
});
}