summaryrefslogtreecommitdiffstats
path: root/js/components/focus_directive.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/focus_directive.js')
-rw-r--r--js/components/focus_directive.js23
1 files changed, 0 insertions, 23 deletions
diff --git a/js/components/focus_directive.js b/js/components/focus_directive.js
deleted file mode 100644
index d82665ce..00000000
--- a/js/components/focus_directive.js
+++ /dev/null
@@ -1,23 +0,0 @@
-angular.module('contactsApp')
-.directive('focusExpression', function ($timeout) {
- return {
- restrict: 'A',
- link: {
- post: function postLink(scope, element, attrs) {
- scope.$watch(attrs.focusExpression, function () {
- if (attrs.focusExpression) {
- if (scope.$eval(attrs.focusExpression)) {
- $timeout(function () {
- if (element.is('input')) {
- element.focus();
- } else {
- element.find('input').focus();
- }
- }, 100); //need some delay to work with ng-disabled
- }
- }
- });
- }
- }
- };
-});