fireEvent reflection socket call, tweaks to Sounds page in ACP

This commit is contained in:
Julian Lam
2014-03-17 11:36:30 -04:00
parent 14a0b45ae8
commit 16f1db4f5d
7 changed files with 48 additions and 23 deletions

View File

@@ -28,8 +28,9 @@ define(function() {
});
};
Settings.save = function(hash, formEl) {
var formEl = $(formEl);
Settings.save = function(hash, formEl, callback) {
formEl = $(formEl);
if (formEl.length) {
var values = formEl.serializeObject();
@@ -39,12 +40,13 @@ define(function() {
}, function(err) {
app.alert({
title: 'Settings Saved',
message: 'Restarting NodeBB <i class="fa fa-spin fa-refresh"></i>',
type: 'success',
timeout: 2500
});
socket.emit('admin.restart');
if (typeof callback === 'function') {
callback();
}
});
} else {
console.log('[settings] Form not found.');