summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-12-07 20:01:39 +0000
committerRobert Speicher <robert@gitlab.com>2015-12-07 20:01:39 +0000
commit9d03bc6fa31f123e070bab4a58b67dbb008e75e9 (patch)
tree20bcdd83efbe8ec9c2d9edaa66384ec7c01eb0fa
parent2e074500b24ec22c0606d475e329888ffeba5de4 (diff)
parent86ed2e43d58ef074ae3b1d80e0b18fe338ca9afd (diff)
downloadgitlab-ce-9d03bc6fa31f123e070bab4a58b67dbb008e75e9.tar.gz
Merge branch 'pberndt:master' into 'master'
Fix #3758: Serious performance issues due to timeago() being called n*(n+1)/2 times instead of n See bug #3758 for a description. This merge request alters `time_ago_with_tooltip` to invoke the `timeago()` javascript on the current timestamp only, instead of each one defined on the page so far. See merge request !1977
-rw-r--r--app/helpers/application_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 3230ff1b004..21f962df206 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -209,7 +209,7 @@ module ApplicationHelper
title: time.in_time_zone.stamp('Aug 21, 2011 9:23pm'),
data: { toggle: 'tooltip', placement: placement, container: 'body' }
- element += javascript_tag "$('.js-timeago').timeago()" unless skip_js
+ element += javascript_tag "$('.js-timeago').last().timeago()" unless skip_js
element
end