diff --git a/resources/views/tasks/time_tracker.blade.php b/resources/views/tasks/time_tracker.blade.php index 3fc769b7bc39..0ff4201405dd 100644 --- a/resources/views/tasks/time_tracker.blade.php +++ b/resources/views/tasks/time_tracker.blade.php @@ -210,7 +210,7 @@ ->large() ->appendIcon(Icon::create('floppy-disk')) ->withAttributes([ - 'data-bind' => 'click: onSaveClick, css: { disabled: ! formChanged() }', + 'data-bind' => 'click: onSaveClick, css: { disabled: ! formChanged() || ! isStartEnabled() }', ]) !!} @@ -465,7 +465,7 @@ if (isMobile) { toastr.warning("{{ trans('texts.time_tracker_mobile_help')}}", false, { timeOut: 10000, - closeButton: true, + closeButton: true, }); if (isIPhone) { link = '{{ NINJA_IOS_APP_URL }}'; diff --git a/resources/views/tasks/time_tracker_knockout.blade.php b/resources/views/tasks/time_tracker_knockout.blade.php index b0c2857ec2d9..c2d76fec2c8a 100644 --- a/resources/views/tasks/time_tracker_knockout.blade.php +++ b/resources/views/tasks/time_tracker_knockout.blade.php @@ -55,6 +55,7 @@ id: task.public_id(), action: action, } + self.isStartEnabled(false); $.ajax({ dataType: 'json', type: 'post', @@ -79,8 +80,11 @@ }, error: function(error) { toastr.error("{{ trans('texts.error_refresh_page') }}"); - swal('failed to bulk save'); } + }).always(function() { + setTimeout(function() { + model.isStartEnabled(true); + }, 1000); }); } @@ -438,7 +442,6 @@ self.save = function(data, isSelected) { if (self.isValid() !== true) { toastr.error("{{ trans('texts.error_refresh_page') }}"); - swal('not valid on save'); throw self.isValid(); return; } @@ -453,6 +456,7 @@ } else { data += '&is_running=0'; } + model.isStartEnabled(false); $.ajax({ dataType: 'json', type: method, @@ -502,14 +506,14 @@ } } model.refreshTitle(); - setTimeout(function() { - model.isStartEnabled(true); - }, 1000); }, error: function(error) { toastr.error("{{ trans('texts.error_refresh_page') }}"); - swal('failed to save'); }, + }).always(function() { + setTimeout(function() { + model.isStartEnabled(true); + }, 1000); }); }