X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gitweb%2Fgitweb.js;h=2a25b7cc470a25572e8741803b4e7124933feff5;hb=637afcf4e07616d1dd15d33f56c6b72f90f39821;hp=5292c37d2ccfb6e9d93cf284d7da215932f1a5b1;hpb=6aa2de51511bf847f6e69dfcfc9e7d977ef171a6;p=git.git diff --git a/gitweb/gitweb.js b/gitweb/gitweb.js index 5292c37d2..2a25b7cc4 100644 --- a/gitweb/gitweb.js +++ b/gitweb/gitweb.js @@ -64,19 +64,19 @@ function fixLinks() { /** * pad number N with nonbreakable spaces on the left, to WIDTH characters - * example: padLeftStr(12, 3, ' ') == ' 12' - * (' ' is nonbreakable space) + * example: padLeftStr(12, 3, '\u00A0') == '\u00A012' + * ('\u00A0' is nonbreakable space) * * @param {Number|String} input: number to pad * @param {Number} width: visible width of output - * @param {String} str: string to prefix to string, e.g. ' ' + * @param {String} str: string to prefix to string, e.g. '\u00A0' * @returns {String} INPUT prefixed with (WIDTH - INPUT.length) x STR */ function padLeftStr(input, width, str) { var prefix = ''; width -= input.toString().length; - while (width > 1) { + while (width > 0) { prefix += str; width--; } @@ -192,7 +192,7 @@ function updateProgressInfo() { if (div_progress_info) { div_progress_info.firstChild.data = blamedLines + ' / ' + totalLines + - ' (' + padLeftStr(percentage, 3, ' ') + '%)'; + ' (' + padLeftStr(percentage, 3, '\u00A0') + '%)'; } if (div_progress_bar) {