From a5e74335a926737a873db080cbb8cbb7c76dfc2b Mon Sep 17 00:00:00 2001 From: gerard Date: Thu, 27 Sep 2018 08:42:36 +0200 Subject: [PATCH] =?UTF-8?q?Tarea=20#658=20dialogo=20de=20a=C3=B1adir=20can?= =?UTF-8?q?tidad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/order/src/prices-popover/index.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/client/order/src/prices-popover/index.js b/client/order/src/prices-popover/index.js index 95a56947f..3567bc6a5 100644 --- a/client/order/src/prices-popover/index.js +++ b/client/order/src/prices-popover/index.js @@ -2,8 +2,9 @@ import ngModule from '../module'; import './style.scss'; class Controller { - constructor($scope, $http, $element) { + constructor($scope, $http, $timeout, $element) { this.$ = $scope; + this.$timeout = $timeout; this.$http = $http; this.$element = $element; this.totalBasquet = 0; @@ -60,9 +61,8 @@ class Controller { } this.validate(); } - validate() { - setTimeout(() => { + this.$timeout(() => { this.calculateTotal(); let inputs = this.$element[0].querySelectorAll('vn-input-number[name="quantity"] div.infix:not(.validated)'); @@ -81,13 +81,6 @@ class Controller { } }); } - - focusFirstInput() { - let inputs = document.querySelectorAll('input[name="quantity"]'); - inputs[inputs.length - 1].querySelector("input").focus(); - this.calculateTotals(); - } - getFilledLines() { let filledLines = []; let match; @@ -106,7 +99,6 @@ class Controller { }); return filledLines; } - submit() { this.calculateTotal(); let filledLines = this.getFilledLines(); @@ -129,7 +121,7 @@ class Controller { } } -Controller.$inject = ['$scope', '$http', '$element']; +Controller.$inject = ['$scope', '$http', '$timeout', '$element']; ngModule.component('vnOrderPricesPopover', { template: require('./index.html'),