Vulcan/client/views/admin/settings_form.js
2014-12-27 18:34:01 +09:00

41 lines
No EOL
927 B
JavaScript

AutoForm.hooks({
updateSettingsForm: {
before: {
update: function(docId, modifier, template) {
template.$('button[type=submit]').addClass('loading');
return modifier;
}
},
onSuccess: function(operation, result, template) {
template.$('button[type=submit]').removeClass('loading');
},
onError: function(operation, result, template) {
template.$('button[type=submit]').removeClass('loading');
}
}
});
AutoForm.hooks({
insertSettingsForm: {
before: {
insert: function(doc, template) {
template.$('button[type=submit]').addClass('loading');
return doc;
}
},
onSuccess: function(operation, result, template) {
template.$('button[type=submit]').removeClass('loading');
},
onError: function(operation, result, template) {
template.$('button[type=submit]').removeClass('loading');
}
}
});