Commit 355c6bf45bd95774d524c9d98627e1ca1fed8e92

Authored by Pablo Marco del Pont
1 parent 2374346145
Exists in master

Cambios según codereview.

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
src/js/controller.js
1 angular.module('appWrapperDemo') 1 angular.module('appWrapperDemo')
2 .controller('appWrapperDemoController', [ 2 .controller('appWrapperDemoController', [
3 '$scope', 3 '$scope',
4 '$rootScope', 4 '$rootScope',
5 '$timeout', 5 '$timeout',
6 function($scope, $rootScope, $timeout) { 6 function($scope, $rootScope, $timeout) {
7 $scope.usarTeclado = false; 7 $scope.usarTeclado = false;
8 $scope.mostrarTeclado = false; 8 $scope.mostrarTeclado = false;
9 $rootScope.$on('focus', function(event) { 9 $rootScope.$on('focus', function(event) {
10 if(!$scope.usarTeclado) { 10 if(!$scope.usarTeclado) {
11 return; 11 return;
12 } 12 }
13 $scope.mostrarTeclado = true; 13 $scope.mostrarTeclado = true;
14 $timeout.cancel($scope.timeout); 14 $timeout.cancel($scope.timeout);
15 if(!$scope.$$phase) { 15 if(!$scope.$$phase) {
16 $scope.$apply(); 16 $scope.$apply();
17 } 17 }
18 }); 18 });
19 $rootScope.$on('blur', function(event) { 19 $rootScope.$on('blur', function(event) {
20 $scope.timeout = $timeout(function(){ 20 $scope.timeout = $timeout(function() {
21 $scope.mostrarTeclado = false; 21 $scope.mostrarTeclado = false;
22 if(!$scope.$$phase) { 22 if(!$scope.$$phase) {
23 $scope.$apply(); 23 $scope.$apply();
24 } 24 }
25 }, 150); 25 }, 150);
26 }); 26 });
27 } 27 }
28 ]); 28 ]);
29 29