Commit e3a487821c4f4533d05fb88f79ec699e799a4c8c
1 parent
3771393739
Exists in
master
and in
1 other branch
- Cambios en bindings.
- Refactor code styling.
Showing
3 changed files
with
9 additions
and
9 deletions
Show diff stats
src/js/escKey-directive.js
... | ... | @@ -3,9 +3,9 @@ angular.module('focaDirectivas') |
3 | 3 | return function(scope, element, attrs) { |
4 | 4 | element.bind('keydown keypress', function(event) { |
5 | 5 | if(event.which === 27) { // 27 = esc key |
6 | - scope.$apply(function (){ | |
6 | + scope.$apply(function() { | |
7 | 7 | scope.$eval(attrs.escKey); |
8 | - }); | |
8 | + }); | |
9 | 9 | event.preventDefault(); |
10 | 10 | } |
11 | 11 | }); |
src/js/focus-directive.js
... | ... | @@ -6,14 +6,14 @@ angular.module('focaDirectivas') |
6 | 6 | } |
7 | 7 | } |
8 | 8 | |
9 | - return { | |
9 | + return { | |
10 | 10 | restrict: "A", |
11 | - link: function (scope, element, attrs, ctrls) { | |
11 | + link: function(scope, element, attrs, ctrls) { | |
12 | 12 | checkDirectivePrerequisites(attrs); |
13 | 13 | |
14 | - scope.$watch(attrs.focaFocus, function (currentValue, lastValue) { | |
14 | + scope.$watch(attrs.focaFocus, function(currentValue, lastValue) { | |
15 | 15 | if(currentValue == true) { |
16 | - $timeout(function () { | |
16 | + $timeout(function() { | |
17 | 17 | element.focus(); |
18 | 18 | }); |
19 | 19 | } |
src/js/tecladoVirtual-directive.js
1 | 1 | angular.module('focaDirectivas') |
2 | 2 | .directive('tecladoVirtual', function() { |
3 | 3 | return function( scope, elem, attrs ) { |
4 | - elem.bind('blur', function() { | |
5 | - scope.$emit('focus', false); | |
4 | + elem.bind('blur', function() { | |
5 | + scope.$emit('blur'); | |
6 | 6 | }); |
7 | 7 | elem.bind('focus', function() { |
8 | - scope.$emit('focus', true); | |
8 | + scope.$emit('focus'); | |
9 | 9 | }); |
10 | 10 | }; |
11 | 11 | }); |