Merge pull request #510 from wknet123/master

Fixed compatibilty issues when creating/editing in dialog box showing error messages.
This commit is contained in:
kun wang 2016-07-11 12:38:23 +08:00 committed by GitHub
commit b61a239ac2
2 changed files with 14 additions and 11 deletions

View File

@ -276,6 +276,7 @@
vm.saveTIP = false; vm.saveTIP = false;
console.log('Successful create replication policy.'); console.log('Successful create replication policy.');
vm.reload(); vm.reload();
vm.closeDialog();
} }
function createReplicationPolicyFailed(data, status) { function createReplicationPolicyFailed(data, status) {
vm.saveTIP = false; vm.saveTIP = false;
@ -290,6 +291,7 @@
console.log('Successful update replication policy.'); console.log('Successful update replication policy.');
vm.reload(); vm.reload();
vm.saveTIP = false; vm.saveTIP = false;
vm.closeDialog();
} }
function updateReplicationPolicyFailed(data, status) { function updateReplicationPolicyFailed(data, status) {
vm.saveTIP = false; vm.saveTIP = false;
@ -398,6 +400,7 @@
}); });
ctrl.save = save; ctrl.save = save;
ctrl.closeDialog = closeDialog;
function save(form) { function save(form) {
@ -420,11 +423,10 @@
ctrl.update(postPayload); ctrl.update(postPayload);
break; break;
} }
$timeout(function() { }
if(!ctrl.toggleErrorMessage) {
element.find('#createPolicyModal').modal('hide'); function closeDialog() {
} element.find('#createPolicyModal').modal('hide');
}, 150);
} }
} }
} }

View File

@ -79,6 +79,7 @@
function createDestinationSuccess(data, status) { function createDestinationSuccess(data, status) {
console.log('Successful created destination.'); console.log('Successful created destination.');
vm.reload(); vm.reload();
vm.closeDialog();
} }
function createDestinationFailed(data, status) { function createDestinationFailed(data, status) {
@ -99,6 +100,7 @@
function updateDestinationSuccess(data, status) { function updateDestinationSuccess(data, status) {
console.log('Successful update destination.'); console.log('Successful update destination.');
vm.reload(); vm.reload();
vm.closeDialog();
} }
function updateDestinationFailed(data, status) { function updateDestinationFailed(data, status) {
@ -221,6 +223,7 @@
}); });
ctrl.save = save; ctrl.save = save;
ctrl.closeDialog = closeDialog;
function save(destination) { function save(destination) {
if(destination) { if(destination) {
@ -235,14 +238,12 @@
ctrl.update(destination); ctrl.update(destination);
break; break;
} }
$timeout(function() {
if(!ctrl.toggleErrorMessage) {
element.find('#createDestinationModal').modal('hide');
}
}, 50);
} }
} }
function closeDialog() {
element.find('#createDestinationModal').modal('hide');
}
} }
} }