diff --git a/index.html b/index.html index 6d61297..2847f35 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,6 @@ - @@ -67,10 +66,10 @@
+ ng-click="usarTeclado = !usarTeclado">
diff --git a/package.json b/package.json index 3025644..1554efa 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "angular-cookies": "^1.7.5", "angular-i18n": "^1.7.5", "angular-ladda": "^0.4.3", - "angular-on-screen-keyboard": "git+https://github.com/ericf97/angular-on-screen-keyboard.git", "angular-route": "^1.7.5", "angular-sanitize": "^1.7.5", "angular-ui-swiper": "^2.3.8", diff --git a/src/js/controller.js b/src/js/controller.js index 128d882..71b519d 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -4,19 +4,25 @@ angular.module('appWrapperDemo') '$rootScope', '$timeout', function($scope, $rootScope, $timeout) { - $scope.hasFocus = false; - var estado; - $rootScope.$on('focus', function(event, data) { - estado = data; - if(!data) { - $timeout(function() { - if(!estado) { - $scope.hasFocus = data; - } - },200) - } else { - $scope.hasFocus = data; + $scope.usarTeclado = false; + $scope.mostrarTeclado = false; + $rootScope.$on('focus', function(event) { + if(!$scope.usarTeclado) { + return; } + $scope.mostrarTeclado = true; + $timeout.cancel($scope.timeout); + if(!$scope.$$phase) { + $scope.$apply(); + } + }); + $rootScope.$on('blur', function(event) { + $scope.timeout = $timeout(function(){ + $scope.mostrarTeclado = false; + if(!$scope.$$phase) { + $scope.$apply(); + } + }, 150); }); } ]); diff --git a/src/sass/_teclado.scss b/src/sass/_teclado.scss index c67acd4..f7883e3 100644 --- a/src/sass/_teclado.scss +++ b/src/sass/_teclado.scss @@ -1,4 +1,3 @@ - .keyboard { -webkit-touch-callout: none; -webkit-user-select: none; @@ -7,10 +6,13 @@ -ms-user-select: none; user-select: none; width: 62%; - height: 60%; + height: auto; margin-left: 13%; margin-top: -19%; - position: absolute; + position: absolute; + border: 1px solid rgba(255, 128, 0, .4); + background-color: rgba(0, 0, 0, .3); + bottom: 5px; table { border-spacing: 10px; border-collapse: separate;