mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 20:32:45 +08:00
FIX: proper logic for 'noTitle' param of the number helper
This commit is contained in:
parent
6d1d7b7c8f
commit
dd3d8d85d3
|
@ -20,11 +20,13 @@ registerUnbound('number', (orig, params) => {
|
|||
if (params['class']) {
|
||||
classNames += ' ' + params['class'];
|
||||
}
|
||||
|
||||
let result = "<span class='" + classNames + "'";
|
||||
let addTitle = params.noTitle ? false : true;
|
||||
|
||||
// Round off the thousands to one decimal place
|
||||
const n = number(orig);
|
||||
if (n.toString() !== title.toString() && !params.noTitle) {
|
||||
if (n.toString() !== title.toString() && addTitle) {
|
||||
result += " title='" + Handlebars.Utils.escapeExpression(title) + "'";
|
||||
}
|
||||
result += ">" + n + "</span>";
|
||||
|
|
Loading…
Reference in New Issue
Block a user