v1.18.x
barisusakli 11 years ago
parent 8eecf59c47
commit fdf19f9025

@ -448,17 +448,18 @@ define('settings', function () {
helper.persistSettings(hash, Settings.cfg, notify, callback); helper.persistSettings(hash, Settings.cfg, notify, callback);
}, },
load: function (hash, formEl, callback) { load: function (hash, formEl, callback) {
callback = callback || function() {};
socket.emit('admin.settings.get', { socket.emit('admin.settings.get', {
hash: hash hash: hash
}, function (err, values) { }, function (err, values) {
if (!err) { if (err) {
$(formEl).deserialize(values);
if (typeof callback === 'function') {
callback();
}
} else {
console.log('[settings] Unable to load settings for hash: ', hash); console.log('[settings] Unable to load settings for hash: ', hash);
return callback(err);
} }
$(formEl).deserialize(values);
callback(null, values);
}); });
}, },
save: function (hash, formEl, callback) { save: function (hash, formEl, callback) {

Loading…
Cancel
Save