Commit d31279610b0a925e0f59d73fecc7f7a1e40fd616
1 parent
7fbb72e845
Exists in
master
code review
Showing
2 changed files
with
19 additions
and
19 deletions
Show diff stats
.jshintrc
| ... | ... | @@ -47,10 +47,10 @@ |
| 47 | 47 | "strict": false, |
| 48 | 48 | |
| 49 | 49 | // Prohibit use of explicitly undeclared variables. |
| 50 | - "undef": true, | |
| 50 | + "undef": false, | |
| 51 | 51 | |
| 52 | 52 | // Warn when variables are defined but never used. |
| 53 | - "unused": true, | |
| 53 | + "unused": false, | |
| 54 | 54 | |
| 55 | 55 | // Para que funcione en angular |
| 56 | 56 | "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"], |
src/js/controller.js
| ... | ... | @@ -20,7 +20,7 @@ angular.module('focaAbmVehiculo') |
| 20 | 20 | focaBotoneraLateralService.showGuardar(false); |
| 21 | 21 | focaBotoneraLateralService.addCustomButton('Salir', salir); |
| 22 | 22 | |
| 23 | - if(focaAbmVehiculoService.transportistaSeleccionado.COD) { | |
| 23 | + if (focaAbmVehiculoService.transportistaSeleccionado.COD) { | |
| 24 | 24 | elegirTransportista(focaAbmVehiculoService.transportistaSeleccionado); |
| 25 | 25 | } |
| 26 | 26 | $scope.editar = function(id) { |
| ... | ... | @@ -28,9 +28,9 @@ angular.module('focaAbmVehiculo') |
| 28 | 28 | }; |
| 29 | 29 | $scope.solicitarConfirmacion = function(vehiculo) { |
| 30 | 30 | focaModalService.confirm('¿Está seguro que desea borrar el vehiculo ' + |
| 31 | - vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( | |
| 31 | + vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( | |
| 32 | 32 | function(data) { |
| 33 | - if(data) { | |
| 33 | + if (data) { | |
| 34 | 34 | focaAbmVehiculoService.deleteVehiculo(vehiculo.id); |
| 35 | 35 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); |
| 36 | 36 | } |
| ... | ... | @@ -77,7 +77,7 @@ angular.module('focaAbmVehiculo') |
| 77 | 77 | }); |
| 78 | 78 | buscar(transportista.COD); |
| 79 | 79 | } |
| 80 | - | |
| 80 | + | |
| 81 | 81 | function buscar(idTransportista) { |
| 82 | 82 | focaAbmVehiculoService |
| 83 | 83 | .getVehiculosPorTransportista(idTransportista) |
| ... | ... | @@ -95,7 +95,7 @@ angular.module('focaAbmVehiculo') |
| 95 | 95 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', |
| 96 | 96 | 'focaModalService', '$timeout', 'focaBotoneraLateralService', |
| 97 | 97 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, |
| 98 | - focaModalService, $timeout, focaBotoneraLateralService) { | |
| 98 | + focaModalService, $timeout, focaBotoneraLateralService) { | |
| 99 | 99 | $scope.nuevo = $routeParams.idVehiculo === '0' ? true : false; |
| 100 | 100 | $scope.now = new Date(); |
| 101 | 101 | $scope.focused = 1; |
| ... | ... | @@ -110,7 +110,7 @@ angular.module('focaAbmVehiculo') |
| 110 | 110 | focaBotoneraLateralService.addCustomButton('Salir', $scope.cancelar); |
| 111 | 111 | }); |
| 112 | 112 | |
| 113 | - if($scope.nuevo) { | |
| 113 | + if ($scope.nuevo) { | |
| 114 | 114 | focaAbmVehiculoService |
| 115 | 115 | .getTransportistaPorId($routeParams.idTransportista) |
| 116 | 116 | .then(function(res) { |
| ... | ... | @@ -125,7 +125,7 @@ angular.module('focaAbmVehiculo') |
| 125 | 125 | } |
| 126 | 126 | $scope.vehiculo = {}; |
| 127 | 127 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { |
| 128 | - if(res.data) { | |
| 128 | + if (res.data) { | |
| 129 | 129 | $scope.transportistaStamp = ('00000' + res.data.transportista.COD).slice(-5); |
| 130 | 130 | $scope.transportistaStamp += ' - ' + res.data.transportista.NOM; |
| 131 | 131 | |
| ... | ... | @@ -154,7 +154,7 @@ angular.module('focaAbmVehiculo') |
| 154 | 154 | $location.path('/vehiculo'); |
| 155 | 155 | }; |
| 156 | 156 | $scope.editar = function(key) { |
| 157 | - if(key) { | |
| 157 | + if (key) { | |
| 158 | 158 | $location.path('/vehiculo/' + $routeParams.idVehiculo + |
| 159 | 159 | '/cisterna/' + key); |
| 160 | 160 | } else { |
| ... | ... | @@ -163,17 +163,17 @@ angular.module('focaAbmVehiculo') |
| 163 | 163 | }; |
| 164 | 164 | $scope.guardar = function(key) { |
| 165 | 165 | |
| 166 | - key = (typeof key === 'undefined') ? 13 : key; | |
| 166 | + key = (typeof key === 'undefined') ? 13 : key; | |
| 167 | 167 | |
| 168 | - if(key === 13) { | |
| 168 | + if (key === 13) { | |
| 169 | 169 | |
| 170 | - if($scope.formVehiculo.$pristine) { | |
| 170 | + if ($scope.formVehiculo.$pristine) { | |
| 171 | 171 | $scope.cancelar(); |
| 172 | 172 | return; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | //Valida si existe numero de unidad |
| 176 | - if(!validaTotalCargas() && !$scope.nuevo) { | |
| 176 | + if (!validaTotalCargas() && !$scope.nuevo) { | |
| 177 | 177 | focaModalService.alert('La suma de las capacidades de las cisternas' + |
| 178 | 178 | ' debe ser igual a la capacidad total del vehículo'); |
| 179 | 179 | return; |
| ... | ... | @@ -200,9 +200,9 @@ angular.module('focaAbmVehiculo') |
| 200 | 200 | }; |
| 201 | 201 | $scope.solicitarConfirmacionCisterna = function(cisterna, idx) { |
| 202 | 202 | focaModalService.confirm('¿Está seguro que desea borrar la cisterna ' + |
| 203 | - cisterna.id + ' ' + cisterna.codigo + ' ?').then( | |
| 203 | + cisterna.id + ' ' + cisterna.codigo + ' ?').then( | |
| 204 | 204 | function(data) { |
| 205 | - if(data) { | |
| 205 | + if (data) { | |
| 206 | 206 | focaAbmVehiculoService.deleteCisterna(idx); |
| 207 | 207 | focaAbmVehiculoService |
| 208 | 208 | .getCisternas($routeParams.idVehiculo) |
| ... | ... | @@ -225,9 +225,9 @@ angular.module('focaAbmVehiculo') |
| 225 | 225 | vehiculo.id !== $scope.vehiculo.id; |
| 226 | 226 | }); |
| 227 | 227 | |
| 228 | - if(existe.length) { | |
| 228 | + if (existe.length) { | |
| 229 | 229 | reject(existe); |
| 230 | - }else { | |
| 230 | + } else { | |
| 231 | 231 | resolve(); |
| 232 | 232 | } |
| 233 | 233 | }); |
| ... | ... | @@ -237,7 +237,7 @@ angular.module('focaAbmVehiculo') |
| 237 | 237 | function validaTotalCargas() { |
| 238 | 238 | var total = 0; |
| 239 | 239 | $scope.cisternas.forEach(function(cisterna) { |
| 240 | - if(!cisterna.desactivado) { | |
| 240 | + if (!cisterna.desactivado) { | |
| 241 | 241 | total += parseInt(cisterna.capacidad); |
| 242 | 242 | } |
| 243 | 243 | }); |