1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Handle task duration change before focusout

This commit is contained in:
Hillel Coren 2017-12-02 23:39:55 +02:00
parent 75260b6fd3
commit 0aa0fb859e

View File

@ -125,7 +125,7 @@
</div>
</td>
<td style="padding: 0px 12px 12px 0 !important; width:100px">
<input type="text" data-bind="value: duration.pretty, visible: !isEmpty(), valueUpdate: 'afterkeydown'" class="form-control duration"></div>
<input type="text" data-bind="value: duration.pretty, visible: !isEmpty()" class="form-control duration"></div>
<a href="#" data-bind="click: function() { setNow(), $root.refresh() }, visible: isEmpty()">{{ trans('texts.set_now') }}</a>
</td>
<td style="width:30px" class="td-icon">
@ -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 }};