From a2de55fae5ec38158a37cd2a62c7487a684b308a Mon Sep 17 00:00:00 2001 From: gerard Date: Wed, 25 Jul 2018 14:18:12 +0200 Subject: [PATCH] Bug #437 Boton cancelar --- client/client/src/greuge/create/index.html | 1 + client/client/src/greuge/create/index.js | 13 ++++++++++++- client/client/src/note/create/index.html | 1 + client/client/src/note/create/index.js | 7 +++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/client/client/src/greuge/create/index.html b/client/client/src/greuge/create/index.html index e502dcd10b..e460bc729e 100644 --- a/client/client/src/greuge/create/index.html +++ b/client/client/src/greuge/create/index.html @@ -40,5 +40,6 @@ + \ No newline at end of file diff --git a/client/client/src/greuge/create/index.js b/client/client/src/greuge/create/index.js index 38ecff50c9..58ceb14284 100644 --- a/client/client/src/greuge/create/index.js +++ b/client/client/src/greuge/create/index.js @@ -8,11 +8,22 @@ class Controller { shipped: new Date() }; } + + cancel(event) { + event.preventDefault(); + event.stopImmediatePropagation(); + this.goToIndex(); + } + + goToIndex() { + this.$state.go('client.card.greuge.index'); + } + onSubmit() { this.greuge.clientFk = this.$state.params.id; this.$.watcher.submit().then( () => { - this.$state.go('client.card.greuge.index'); + this.goToIndex(); } ); } diff --git a/client/client/src/note/create/index.html b/client/client/src/note/create/index.html index 1351de7089..ce5c80926a 100644 --- a/client/client/src/note/create/index.html +++ b/client/client/src/note/create/index.html @@ -21,5 +21,6 @@ + \ No newline at end of file diff --git a/client/client/src/note/create/index.js b/client/client/src/note/create/index.js index d6c557eee2..b8ef275e30 100644 --- a/client/client/src/note/create/index.js +++ b/client/client/src/note/create/index.js @@ -2,11 +2,18 @@ import ngModule from '../../module'; export default class Controller { constructor($state) { + this.$state = $state; this.note = { clientFk: parseInt($state.params.id), text: null }; } + + cancel(event) { + event.preventDefault(); + event.stopImmediatePropagation(); + this.$state.go('client.card.note.index', {id: this.$state.params.id}); + } } Controller.$inject = ['$state'];