From 57830316add2607857a0e53c012553a6d1432bd9 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 2 Mar 2017 20:10:38 +0200 Subject: [PATCH] Fix initial focus on /tasks/create --- resources/views/tasks/edit.blade.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/tasks/edit.blade.php b/resources/views/tasks/edit.blade.php index 388dddae8d41..80c21bb1403f 100644 --- a/resources/views/tasks/edit.blade.php +++ b/resources/views/tasks/edit.blade.php @@ -443,12 +443,6 @@ ko.applyBindings(model); $(function() { - @if (!$task && !$clientPublicId) - $('.client-select input.form-control').focus(); - @else - $('#description').focus(); - @endif - $('input[type=radio]').change(function(event) { var val = $(event.target).val(); if (val == 'timer') { @@ -595,6 +589,12 @@ } else { $clientSelect.trigger('change'); } + + @if (!$task && !$clientPublicId) + $('.client-select input.form-control').focus(); + @else + $('#description').focus(); + @endif });