Bug #437 Boton cancelar
This commit is contained in:
parent
82b0323847
commit
d6f3f22970
|
@ -102,5 +102,6 @@
|
|||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Save"></vn-submit>
|
||||
<vn-button ng-click="$ctrl.cancel($event)" label="Cancel"></vn-button>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
|
|
|
@ -12,6 +12,16 @@ export default class Controller {
|
|||
this.$.model.remove(index);
|
||||
}
|
||||
|
||||
cancel(event) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
this.goToIndex();
|
||||
}
|
||||
|
||||
goToIndex() {
|
||||
this.$state.go('client.card.address.index');
|
||||
}
|
||||
|
||||
submit() {
|
||||
this.$.watcher.check();
|
||||
this.$.watcher.realSubmit()
|
||||
|
@ -20,7 +30,7 @@ export default class Controller {
|
|||
this.$.watcher.setPristine();
|
||||
this.$.watcher.notifySaved();
|
||||
this.card.reload();
|
||||
this.$state.go('client.card.address.index', {id: this.$stateParams.id});
|
||||
this.goToIndex();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Save"></vn-submit>
|
||||
<vn-button ng-click="$ctrl.cancel($event)" label="Cancel"></vn-button>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
<vn-confirm
|
||||
|
|
|
@ -17,15 +17,25 @@ class Controller {
|
|||
});
|
||||
}
|
||||
|
||||
cancel(event) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
this.goToIndex();
|
||||
}
|
||||
|
||||
returnDialog(response) {
|
||||
if (response === 'ACCEPT')
|
||||
this.addCredit();
|
||||
}
|
||||
|
||||
goToIndex() {
|
||||
this.$state.go('client.card.credit.index');
|
||||
}
|
||||
|
||||
addCredit() {
|
||||
this.$scope.watcher.submit().then(
|
||||
() => {
|
||||
this.$state.go('client.card.credit.index');
|
||||
this.goToIndex();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -38,5 +38,6 @@
|
|||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Save"></vn-submit>
|
||||
<vn-button ng-click="$ctrl.cancel($event)" label="Cancel"></vn-button>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
|
|
|
@ -8,11 +8,22 @@ class Controller {
|
|||
started: new Date()
|
||||
};
|
||||
}
|
||||
|
||||
cancel(event) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
this.goToIndex();
|
||||
}
|
||||
|
||||
goToIndex() {
|
||||
this.$state.go('client.card.recovery.index');
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
this.recovery.clientFk = this.$state.params.id;
|
||||
this.$.watcher.submit().then(
|
||||
() => {
|
||||
this.$state.go('client.card.recovery.index');
|
||||
this.goToIndex();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue