linting setting.js again and abstracting out saveField

v1.18.x
Julian Lam 11 years ago
parent 0a293be823
commit e611a8174e

@ -61,10 +61,41 @@ define(['uploader'], function(uploader) {
} }
}); });
$('#uploadLogoBtn').on('click', function() {
uploader.open(RELATIVE_PATH + '/admin/uploadlogo', {}, 0, function(image) {
$('#logoUrl').val(image);
});
uploader.hideAlerts();
});
$('#uploadFaviconBtn').on('click', function() {
uploader.open(RELATIVE_PATH + '/admin/uploadfavicon', {}, 0, function(icon) {
$('#faviconUrl').val(icon);
});
uploader.hideAlerts();
});
$('#settings-tab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
return false;
});
if (typeof callback === 'function') {
callback();
}
};
Settings.remove = function(key) {
socket.emit('admin.config.remove', key);
};
function saveField(field) { function saveField(field) {
field = $(field); field = $(field);
var key = field.attr('data-field'), var key = field.attr('data-field'),
value; value, inputType;
if (field.is('input')) { if (field.is('input')) {
inputType = field.attr('type'); inputType = field.attr('type');
@ -113,37 +144,6 @@ define(['uploader'], function(uploader) {
}); });
}); });
}
$('#uploadLogoBtn').on('click', function() {
uploader.open(RELATIVE_PATH + '/admin/uploadlogo', {}, 0, function(image) {
$('#logoUrl').val(image);
});
uploader.hideAlerts();
});
$('#uploadFaviconBtn').on('click', function() {
uploader.open(RELATIVE_PATH + '/admin/uploadfavicon', {}, 0, function(icon) {
$('#faviconUrl').val(icon);
});
uploader.hideAlerts();
});
$('#settings-tab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
return false;
});
if (typeof callback === 'function') {
callback();
}
};
Settings.remove = function(key) {
socket.emit('admin.config.remove', key);
}; };
return Settings; return Settings;

Loading…
Cancel
Save