fix(formatter): Item Link formatter when input is disabled (#6263)

This commit is contained in:
Faris Ansari 2018-10-16 10:14:35 +05:30 committed by GitHub
parent 5966faa468
commit 18bfb6df5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -436,10 +436,11 @@ _f.Frm.prototype.set_indicator_formatter = function(fieldname, get_color, get_te
frappe.meta.docfield_map[doctype][fieldname].formatter =
function(value, df, options, doc) {
if(value) {
const escaped_name = encodeURIComponent(value);
return repl('<a class="indicator %(color)s" href="#Form/%(doctype)s/%(name)s">%(label)s</a>', {
color: get_color(doc || {}),
doctype: df.options,
name: value,
name: escaped_name,
label: get_text ? get_text(doc) : value
});
} else {
@ -516,4 +517,4 @@ _f.Frm.prototype.get_sum = function(table_fieldname, fieldname) {
sum += d[fieldname];
}
return sum;
};
};