Fixes Discard Changes & Save buttons in Settings page

This commit is contained in:
Jared Tabor 2018-07-03 15:17:49 -07:00
parent 2f108e55f3
commit a4e9f18d2b
No known key found for this signature in database
GPG Key ID: CC50E67C506270C9

View File

@ -317,15 +317,21 @@ export default [
"class": "btn Form-cancelButton",
"id": "formmodal-cancel-button",
onClick: function() {
clearApiErrors();
populateFromApi();
$scope[formTracker.currentFormName()].$setPristine();
$('#FormModal-dialog').dialog('close');
$state.go('setup');
}
}, {
label: i18n._("Save changes"),
onClick: function() {
$scope.formSave();
$('#FormModal-dialog').dialog('close');
$state.go('setup');
vm.formSave().then(() => {
$scope[formTracker.currentFormName()].$setPristine();
$('#FormModal-dialog').dialog('close');
}).catch(()=> {
event.preventDefault();
$('#FormModal-dialog').dialog('close');
});
},
"class": "btn btn-primary",
"id": "formmodal-save-button"