Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redmine 4.1.1 compatibility #66

Open
urobasa opened this issue Apr 22, 2020 · 4 comments
Open

Redmine 4.1.1 compatibility #66

urobasa opened this issue Apr 22, 2020 · 4 comments

Comments

@urobasa
Copy link

urobasa commented Apr 22, 2020

After click start - status not refresh.
see the timer only if refresh page or timeout refresh plugin time

@stepozer
Copy link

@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.

@speedy32129
Copy link
Owner

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!!!

@stepozer
Copy link

@speedy32129 I created PR with backward compatibility - #67

@chmich
Copy link

chmich commented Mar 4, 2021

@stepozer
Thanks a lot, worked for me (Redmine 4.1.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants