summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authormhasbini <mohammad.hasbini@gmail.com>2017-02-21 21:21:49 +0200
committermhasbini <mohammad.hasbini@gmail.com>2017-02-21 21:21:49 +0200
commit0a53a3d9664187cbd8c72c24666a8ff03f3dccec (patch)
treea3bf55f0d7403ed662a09a413b23f876587deebe /app/assets/javascripts
parent881529495379505542033bf7fb0d91cdc5b51e8d (diff)
downloadgitlab-ce-0a53a3d9664187cbd8c72c24666a8ff03f3dccec.tar.gz
change todos counter position & format ( for large counts )
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/header.js2
-rw-r--r--app/assets/javascripts/lib/utils/text_utility.js3
2 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/header.js b/app/assets/javascripts/header.js
index fa85f9a6c86..a853c3aeb1f 100644
--- a/app/assets/javascripts/header.js
+++ b/app/assets/javascripts/header.js
@@ -2,7 +2,7 @@
(function() {
$(document).on('todo:toggle', function(e, count) {
var $todoPendingCount = $('.todos-pending-count');
- $todoPendingCount.text(gl.text.addDelimiter(count));
+ $todoPendingCount.text(gl.text.highCountTrim(count));
$todoPendingCount.toggleClass('hidden', count === 0);
});
})();
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js
index f755d212b3c..579d322e3fb 100644
--- a/app/assets/javascripts/lib/utils/text_utility.js
+++ b/app/assets/javascripts/lib/utils/text_utility.js
@@ -14,6 +14,9 @@ require('vendor/latinise');
gl.text.addDelimiter = function(text) {
return text ? text.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") : text;
};
+ gl.text.highCountTrim = function(count) {
+ return count > 99 ? '99+' : count;
+ };
gl.text.randomString = function() {
return Math.random().toString(36).substring(7);
};