Commit f5d993b9b46c78f68ae0afccebdd7bd55dcfa37d
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
z-index solo en boton "Teclado", agrego boton cancelar See merge request !2
Showing
3 changed files
Show diff stats
src/js/controller.js
| 1 | angular.module('focaBotoneraLateral') | 1 | angular.module('focaBotoneraLateral') |
| 2 | .controller('focaBotoneraLateralController', [ | 2 | .controller('focaBotoneraLateralController', [ |
| 3 | '$scope', | 3 | '$scope', |
| 4 | '$location', | 4 | '$location', |
| 5 | '$window', | ||
| 5 | 'focaBotoneraLateralService', | 6 | 'focaBotoneraLateralService', |
| 6 | function($scope, $location, focaBotoneraLateralService) { | 7 | function($scope, $location, $window, focaBotoneraLateralService) { |
| 7 | 8 | ||
| 8 | $scope.service = focaBotoneraLateralService.variables; | 9 | $scope.botones = focaBotoneraLateralService.botones; |
| 9 | 10 | ||
| 10 | $scope.cambioUsoTeclado = function() { | 11 | $scope.cambioUsoTeclado = function() { |
| 11 | $scope.$parent.cambioUsoTeclado(); | 12 | $scope.$parent.cambioUsoTeclado(); |
| 12 | }; | 13 | }; |
| 13 | 14 | ||
| 14 | $scope.salir = function() { | 15 | $scope.salir = function() { |
| 15 | $location.path('/'); | 16 | $location.path('/'); |
| 16 | }; | 17 | }; |
| 18 | |||
| 19 | $scope.cancelar = function() { | ||
| 20 | $window.history.back(); | ||
| 21 | }; | ||
| 17 | }]); | 22 | }]); |
| 18 | 23 |
src/js/service.js
| 1 | angular.module('focaBotoneraLateral') | 1 | angular.module('focaBotoneraLateral') |
| 2 | .service('focaBotoneraLateralService', function() { | 2 | .service('focaBotoneraLateralService', function() { |
| 3 | 3 | ||
| 4 | this.variables = { | 4 | this.botones = { |
| 5 | salir: false, | 5 | salir: false, |
| 6 | cancelar: false, | ||
| 6 | pausar: false, | 7 | pausar: false, |
| 7 | guardar: false, | 8 | guardar: false, |
| 8 | funcionGuardar: undefined | 9 | funcionGuardar: undefined |
| 9 | }; | 10 | }; |
| 10 | 11 | ||
| 11 | this.showSalir = function(value) { | 12 | this.showSalir = function(value) { |
| 12 | this.variables.salir = value; | 13 | this.botones.salir = value; |
| 13 | }; | 14 | }; |
| 14 | this.showPausar = function(value) { | 15 | this.showPausar = function(value) { |
| 15 | this.variables.pausar = value; | 16 | this.botones.pausar = value; |
| 17 | }; | ||
| 18 | this.showCancelar = function(value, funcion) { | ||
| 19 | this.botones.cancelar = value; | ||
| 20 | if(value) this.botones.funcionCancelar = funcion; | ||
| 16 | }; | 21 | }; |
| 17 | this.showGuardar = function(value, funcion) { | 22 | this.showGuardar = function(value, funcion) { |
| 18 | this.variables.guardar = value; | 23 | this.botones.guardar = value; |
| 19 | if(value) this.variables.funcionGuardar = funcion; | 24 | if(value) this.botones.funcionGuardar = funcion; |
| 20 | }; | 25 | }; |
| 21 | 26 | ||
| 22 | }); | 27 | }); |
| 23 | 28 |
src/views/botonera-lateral.html
| 1 | <div class="container botonera-lateral"> | 1 | <div class="container botonera-lateral"> |
| 2 | <div class="row"> | 2 | <div class="row"> |
| 3 | <button | 3 | <div class="col-auto my-2 col-2 offset-10 d-none d-md-flex" style="min-height: 176px"> |
| 4 | ng-click="service.funcionGuardar()" | 4 | <div class="px-2 mt-auto"> |
| 5 | ng-show="service.guardar" | 5 | <div class="container"> |
| 6 | type="button" | 6 | <div class="row"> |
| 7 | title="Salir" | 7 | <button |
| 8 | class="btn btn-block border border-dark"> | 8 | ng-click="botones.funcionGuardar()" |
| 9 | <strong>GUARDAR</strong> | 9 | ng-show="botones.guardar" |
| 10 | </button> | 10 | type="button" |
| 11 | <button | 11 | title="Guardar" |
| 12 | ng-show="service.pausar" | 12 | class="btn btn-block border border-dark"> |
| 13 | type="button" | 13 | <strong>GUARDAR</strong> |
| 14 | title="Salir" | 14 | </button> |
| 15 | class="btn btn-block border border-dark"> | 15 | <button |
| 16 | <strong>PAUSAR</strong> | 16 | ng-show="botones.pausar" |
| 17 | </button> | 17 | type="button" |
| 18 | <button | 18 | title="Pausar" |
| 19 | ng-click="salir()" | 19 | class="btn btn-block border border-dark"> |
| 20 | ng-show="service.salir" | 20 | <strong>PAUSAR</strong> |
| 21 | type="button" | 21 | </button> |
| 22 | title="Salir" | 22 | <button |
| 23 | class="btn btn-block border border-dark"> | 23 | ng-click="cancelar()" |
| 24 | <strong>SALIR</strong> | 24 | ng-show="botones.cancelar" |
| 25 | </button> | 25 | type="button" |
| 26 | <div | 26 | title="Cancelar" |
| 27 | class="btn-group-toggle btn btn-block btn-default border border-dark" | 27 | class="btn btn-block border border-dark"> |
| 28 | data-toggle="buttons" | 28 | <strong>CANCELAR</strong> |
| 29 | ng-click="cambioUsoTeclado()" | 29 | </button> |
| 30 | title="Activar/desactivar teclado"> | 30 | <button |
| 31 | <label | 31 | ng-click="salir()" |
| 32 | class=" active boton-activar-teclado mb-0" | 32 | ng-show="botones.salir" |
| 33 | ng-class="{'teclado-activar': usarTeclado}"> | 33 | type="button" |
| 34 | <input | 34 | title="Salir" |
| 35 | type="checkbox" | 35 | class="btn btn-block border border-dark"> |
| 36 | autocomplete="off" | 36 | <strong>SALIR</strong> |
| 37 | > | 37 | </button> |
| 38 | <strong>TECLADO</strong> | 38 | </div> |
| 39 | </label> | 39 | </div> |
| 40 | </div> | ||
| 40 | </div> | 41 | </div> |
| 41 | </div> | 42 | </div> |
| 42 | </div> | 43 | </div> |
| 44 | <div class="container botonera-lateral teclado"> | ||
| 45 | <div class="row"> | ||
| 46 | <div class="col-auto my-2 col-2 offset-10 d-none d-md-flex" style="min-height: 176px"> | ||
| 47 | <div class="px-2 mt-auto"> | ||
| 48 | <div class="container"> | ||
| 49 | <div class="row"> | ||
| 50 | <div | ||
| 51 | class="btn-group-toggle btn btn-block btn-default border border-dark" | ||
| 52 | data-toggle="buttons" | ||
| 53 | ng-click="cambioUsoTeclado()" | ||
| 54 | title="Activar/desactivar teclado"> | ||
| 55 | <label | ||
| 56 | class=" active boton-activar-teclado mb-0" | ||
| 57 | ng-class="{'teclado-activar': usarTeclado}"> | ||
| 58 | <input | ||
| 59 | type="checkbox" | ||
| 60 | autocomplete="off" | ||
| 61 | > | ||
| 62 | <strong>TECLADO</strong> | ||
| 63 | </label> | ||
| 64 | </div> | ||
| 65 | </div> | ||
| 66 | </div> | ||
| 67 | </div> | ||
| 68 | </div> | ||
| 69 | </div> | ||
| 70 | </div> | ||
| 43 | 71 |