time_logger
time_logger copied to clipboard
Redmine 4.1.1 compatibility
After click start - status not refresh. see the timer only if refresh page or timeout refresh plugin time
@urobasa and @speedy32129 I found what is the issue with this plugin for redmine 4.1.1. Right now redmine use rails 5 and in official doc for rails we can see (https://guides.rubyonrails.org/working_with_javascript_in_rails.html):
As of Rails 5.1 and the new rails-ujs, the parameters data, status, xhr have been bundled into event.detail. For information about the previously used jquery-ujs in Rails 5 and earlier, read the jquery-ujs wiki.
so we must replace code for 'ajax:success'
event handler into something like this:
$(document).on('ajax:success', '[data-remote][data-replace]', function(event) {
var $this = $(this);
$($this.data('replace')).html(event.detail[2].response);
$this.trigger('ajax:replaced');
return true;
});
After this fix everything work for me. Let me know if I can help with PR.
stepozer thanks for your contribution is much appreciated! I just tested this and that works. I did see the page update after the refresh interval was meet but that seems to make it instant. I'm not a javascript person at all so once again thanks for the contribution!!!
@speedy32129 I created PR with backward compatibility - https://github.com/speedy32129/time_logger/pull/67
@stepozer Thanks a lot, worked for me (Redmine 4.1.1)