From b17dac96edfda656e227d93f177c6b1cff89fe5b Mon Sep 17 00:00:00 2001 From: Eric Heikes Date: Fri, 3 Jul 2015 20:33:04 -0500 Subject: [PATCH] After resetting search, move focus back to the search field. --- toread.js | 3 ++- toreadcontrols.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/toread.js b/toread.js index 575580b..d60a26d 100644 --- a/toread.js +++ b/toread.js @@ -117,9 +117,10 @@ module.directive('list', function($timeout, toreadService) { }); }; - scope.clearSearch = function() { + scope.clearSearch = function(event) { scope.q = ''; scope.showList(); + angular.element(event.target).parents('.search').find('input[name="q"]').focus(); }; scope.$on('refreshList', scope.showList); diff --git a/toreadcontrols.html b/toreadcontrols.html index 1734cfc..69ee095 100644 --- a/toreadcontrols.html +++ b/toreadcontrols.html @@ -6,10 +6,10 @@