From 0aa0fb859e22657e7b7a10a251d2113b3cb7a3c0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 2 Dec 2017 23:39:55 +0200 Subject: [PATCH] Handle task duration change before focusout --- resources/views/tasks/edit.blade.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/views/tasks/edit.blade.php b/resources/views/tasks/edit.blade.php index 2ff848fa7d9a..4deda34d96f8 100644 --- a/resources/views/tasks/edit.blade.php +++ b/resources/views/tasks/edit.blade.php @@ -125,7 +125,7 @@ - + {{ trans('texts.set_now') }} @@ -352,11 +352,6 @@ self.duration.pretty = ko.computed({ read: function() { - // handle the input being changed and the form is submitted before focus out - if ($("input.duration").is(":focus")) { - return $("input.duration").val(); - } - var duration = false; var start = self.startTime(); var end = self.endTime(); @@ -541,6 +536,13 @@ showTimeDetails(); @endif + $('input.duration').keydown(function(event){ + if (event.keyCode == 13) { + event.preventDefault(); + return false; + } + }); + // setup clients and project comboboxes var clientId = {{ $clientPublicId }}; var projectId = {{ $projectPublicId }};