Commit 40803c651d590d079b6eeb1de1aa33d9e5fcc466
1 parent
8095aed574
Exists in
master
z-index solo en boton "Teclado", agrego boton cancelar
Showing
3 changed files
with
82 additions
and
44 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -2,10 +2,11 @@ angular.module('focaBotoneraLateral') |
| 2 | 2 | .controller('focaBotoneraLateralController', [ |
| 3 | 3 | '$scope', |
| 4 | 4 | '$location', |
| 5 | + '$window', | |
| 5 | 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 | 11 | $scope.cambioUsoTeclado = function() { |
| 11 | 12 | $scope.$parent.cambioUsoTeclado(); |
| ... | ... | @@ -14,4 +15,8 @@ angular.module('focaBotoneraLateral') |
| 14 | 15 | $scope.salir = function() { |
| 15 | 16 | $location.path('/'); |
| 16 | 17 | }; |
| 18 | + | |
| 19 | + $scope.cancelar = function() { | |
| 20 | + $window.history.back(); | |
| 21 | + }; | |
| 17 | 22 | }]); |
src/js/service.js
| 1 | 1 | angular.module('focaBotoneraLateral') |
| 2 | 2 | .service('focaBotoneraLateralService', function() { |
| 3 | 3 | |
| 4 | - this.variables = { | |
| 4 | + this.botones = { | |
| 5 | 5 | salir: false, |
| 6 | + cancelar: false, | |
| 6 | 7 | pausar: false, |
| 7 | 8 | guardar: false, |
| 8 | 9 | funcionGuardar: undefined |
| 9 | 10 | }; |
| 10 | 11 | |
| 11 | 12 | this.showSalir = function(value) { |
| 12 | - this.variables.salir = value; | |
| 13 | + this.botones.salir = value; | |
| 13 | 14 | }; |
| 14 | 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 | 22 | this.showGuardar = function(value, funcion) { |
| 18 | - this.variables.guardar = value; | |
| 19 | - if(value) this.variables.funcionGuardar = funcion; | |
| 23 | + this.botones.guardar = value; | |
| 24 | + if(value) this.botones.funcionGuardar = funcion; | |
| 20 | 25 | }; |
| 21 | 26 | |
| 22 | 27 | }); |
src/views/botonera-lateral.html
| 1 | 1 | <div class="container botonera-lateral"> |
| 2 | 2 | <div class="row"> |
| 3 | - <button | |
| 4 | - ng-click="service.funcionGuardar()" | |
| 5 | - ng-show="service.guardar" | |
| 6 | - type="button" | |
| 7 | - title="Salir" | |
| 8 | - class="btn btn-block border border-dark"> | |
| 9 | - <strong>GUARDAR</strong> | |
| 10 | - </button> | |
| 11 | - <button | |
| 12 | - ng-show="service.pausar" | |
| 13 | - type="button" | |
| 14 | - title="Salir" | |
| 15 | - class="btn btn-block border border-dark"> | |
| 16 | - <strong>PAUSAR</strong> | |
| 17 | - </button> | |
| 18 | - <button | |
| 19 | - ng-click="salir()" | |
| 20 | - ng-show="service.salir" | |
| 21 | - type="button" | |
| 22 | - title="Salir" | |
| 23 | - class="btn btn-block border border-dark"> | |
| 24 | - <strong>SALIR</strong> | |
| 25 | - </button> | |
| 26 | - <div | |
| 27 | - class="btn-group-toggle btn btn-block btn-default border border-dark" | |
| 28 | - data-toggle="buttons" | |
| 29 | - ng-click="cambioUsoTeclado()" | |
| 30 | - title="Activar/desactivar teclado"> | |
| 31 | - <label | |
| 32 | - class=" active boton-activar-teclado mb-0" | |
| 33 | - ng-class="{'teclado-activar': usarTeclado}"> | |
| 34 | - <input | |
| 35 | - type="checkbox" | |
| 36 | - autocomplete="off" | |
| 37 | - > | |
| 38 | - <strong>TECLADO</strong> | |
| 39 | - </label> | |
| 3 | + <div class="col-auto my-2 col-2 offset-10 d-none d-md-flex" style="min-height: 176px"> | |
| 4 | + <div class="px-2 mt-auto"> | |
| 5 | + <div class="container"> | |
| 6 | + <div class="row"> | |
| 7 | + <button | |
| 8 | + ng-click="botones.funcionGuardar()" | |
| 9 | + ng-show="botones.guardar" | |
| 10 | + type="button" | |
| 11 | + title="Guardar" | |
| 12 | + class="btn btn-block border border-dark"> | |
| 13 | + <strong>GUARDAR</strong> | |
| 14 | + </button> | |
| 15 | + <button | |
| 16 | + ng-show="botones.pausar" | |
| 17 | + type="button" | |
| 18 | + title="Pausar" | |
| 19 | + class="btn btn-block border border-dark"> | |
| 20 | + <strong>PAUSAR</strong> | |
| 21 | + </button> | |
| 22 | + <button | |
| 23 | + ng-click="cancelar()" | |
| 24 | + ng-show="botones.cancelar" | |
| 25 | + type="button" | |
| 26 | + title="Cancelar" | |
| 27 | + class="btn btn-block border border-dark"> | |
| 28 | + <strong>CANCELAR</strong> | |
| 29 | + </button> | |
| 30 | + <button | |
| 31 | + ng-click="salir()" | |
| 32 | + ng-show="botones.salir" | |
| 33 | + type="button" | |
| 34 | + title="Salir" | |
| 35 | + class="btn btn-block border border-dark"> | |
| 36 | + <strong>SALIR</strong> | |
| 37 | + </button> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 40 | 41 | </div> |
| 41 | 42 | </div> |
| 42 | 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 | \ No newline at end of file |