Fix initial focus on /tasks/create

This commit is contained in:
Hillel Coren 2017-03-02 20:10:38 +02:00
parent 1ac32c13a7
commit 57830316ad

View File

@ -443,12 +443,6 @@
ko.applyBindings(model); ko.applyBindings(model);
$(function() { $(function() {
@if (!$task && !$clientPublicId)
$('.client-select input.form-control').focus();
@else
$('#description').focus();
@endif
$('input[type=radio]').change(function(event) { $('input[type=radio]').change(function(event) {
var val = $(event.target).val(); var val = $(event.target).val();
if (val == 'timer') { if (val == 'timer') {
@ -595,6 +589,12 @@
} else { } else {
$clientSelect.trigger('change'); $clientSelect.trigger('change');
} }
@if (!$task && !$clientPublicId)
$('.client-select input.form-control').focus();
@else
$('#description').focus();
@endif
}); });
</script> </script>