David пре 10 година
родитељ
комит
e933dee16b
2 измењених фајлова са 11 додато и 4 уклоњено
  1. 3 0
      controllers/facturaCtrl.js
  2. 8 4
      views/main.html

+ 3 - 0
controllers/facturaCtrl.js

@@ -5,6 +5,9 @@ app.controller('facturaCtrl', function ($scope, $http, $window, notify,$location
 	var user = $location.search().user;
 	if (user == undefined)
 		user="";
+	$scope.confirmar = function() {
+		$scope.cero=false;
+	};
 	$scope.update = function() {
 		$http.get('back/cliente/' + user).success(function(data) {
 	   		$scope.userdata = data; 

+ 8 - 4
views/main.html

@@ -29,7 +29,11 @@
 				<th>Total</th>
 			</tr>
 			<tr ng-repeat="p in listaproductos | filter: filtro | filter:filterCero(criteria) track by p.id">
-				<td><input ng-change="updateTotal()" type=number class="form-control" ng-model="p.cantidad" value="0" min="0" max="100" style='width:70px;text-align:center;'></td>
+				<td>
+					<input ng-change="updateTotal()" type="number" onclick="this.select();" class="form-control" ng-model="p.cantidad" value="0" min="0" max="100"
+						ng-disabled="!cero"
+						style='width:70px;text-align:center;'>
+				</td>
 				<td>{{p.id}}</td>
 				<td>{{p.nombre}}</td>
 				<td>${{p.precio}}</td>
@@ -46,12 +50,12 @@
 		</div>
 		<div class="row">
 			<div class="col-md-12">
-				<button ng-show="cero==1" class="css-button" ng-click="cero=0">Confirmar</button>
-				<button ng-show="cero==0" class="css-button" ng-click="cero=1">Modificar</button>
+				<button ng-show="cero==true" class="css-button" ng-click="confirmar()">Confirmar</button>
+				<button ng-show="cero==false" class="css-button" ng-click="cero=true">Modificar</button>
 				<!--
 				<button class="css-button" ng-click="">Ver pedido</button>
 				-->
-				<button ng-show="cero==0" class="css-button" ng-click="ok()">Enviar Pedido</button>
+				<button ng-show="cero==false" class="css-button" ng-click="ok()">Enviar Pedido</button>
 			</div>
 		</div>
 	</div>