diff --git a/src/js/controller/write.js b/src/js/controller/write.js index 3be3deb..5713ec6 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -448,29 +448,6 @@ var WriteCtrl = function($scope, $filter, $q) { var ngModule = angular.module('write', []); -ngModule.directive('focusMe', function($timeout, $parse) { - return { - //scope: true, // optionally create a child scope - link: function(scope, element, attrs) { - var model = $parse(attrs.focusMe); - scope.$watch(model, function(value) { - if (value === true) { - $timeout(function() { - var el = element[0]; - el.focus(); - // set cursor to start of textarea - if (el.type === 'textarea') { - el.selectionStart = 0; - el.selectionEnd = 0; - el.scrollTop = 0; - } - }, 100); - } - }); - } - }; -}); - ngModule.directive('focusInput', function($timeout, $parse) { return { //scope: true, // optionally create a child scope diff --git a/src/js/directive/common.js b/src/js/directive/common.js index e34cb8d..52dc403 100644 --- a/src/js/directive/common.js +++ b/src/js/directive/common.js @@ -143,4 +143,24 @@ ngModule.directive('woDropdown', function($document, $timeout) { }; }); +ngModule.directive('woFocusMe', function($timeout, $parse) { + return function(scope, element, attrs) { + var model = $parse(attrs.woFocusMe); + scope.$watch(model, function(value) { + if (value === true) { + $timeout(function() { + var el = element[0]; + el.focus(); + // set cursor to start of textarea + if (el.type === 'textarea') { + el.selectionStart = 0; + el.selectionEnd = 0; + el.scrollTop = 0; + } + }, 100); + } + }); + }; +}); + module.exports = ngModule; \ No newline at end of file diff --git a/src/tpl/action-bar.html b/src/tpl/action-bar.html index 44f9b5a..4598bb4 100644 --- a/src/tpl/action-bar.html +++ b/src/tpl/action-bar.html @@ -20,7 +20,7 @@ + placeholder="Search" wo-focus-me="state.mailList.searching"> diff --git a/src/tpl/create-account.html b/src/tpl/create-account.html index aca0e1f..f946074 100644 --- a/src/tpl/create-account.html +++ b/src/tpl/create-account.html @@ -10,7 +10,7 @@
Please confirm the keychain code you have written down.