diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-11 21:57:49 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-11 21:57:49 +0300 |
commit | 456ddb5eb7f905899bd1a6258617eb505f4dc289 (patch) | |
tree | 2e398831b9bb23cc521ed7fd55b2f6c7e0d093df /app/helpers/application_helper.rb | |
parent | 722f14816c85bc5996caac33adb4e4c54e6efdfc (diff) |
Fix time_ago_with_tooltip for activity feed
Closes #4002
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 21f962df206..39d3017162e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -204,12 +204,16 @@ module ApplicationHelper # Returns an HTML-safe String def time_ago_with_tooltip(time, placement: 'top', html_class: 'time_ago', skip_js: false) element = content_tag :time, time.to_s, - class: "#{html_class} js-timeago", + class: "#{html_class} js-timeago js-timeago-pending", datetime: time.getutc.iso8601, title: time.in_time_zone.stamp('Aug 21, 2011 9:23pm'), data: { toggle: 'tooltip', placement: placement, container: 'body' } - element += javascript_tag "$('.js-timeago').last().timeago()" unless skip_js + unless skip_js + element << javascript_tag( + "$('.js-timeago-pending').removeClass('js-timeago-pending').timeago()" + ) + end element end |