[fixes] tree and frappe/erpnext#2717
This commit is contained in:
parent
9cea07094b
commit
cba28a2ba0
3 changed files with 9 additions and 3 deletions
|
|
@ -129,10 +129,13 @@ frappe.ui.form.ControlImage = frappe.ui.form.Control.extend({
|
|||
.css({"margin-bottom": "10px", "max-width": "100%"})
|
||||
|
||||
this.$wrapper.on("refresh", function() {
|
||||
var doc = null;
|
||||
me.$body.empty();
|
||||
|
||||
var doc = frappe.model.get_doc(me.doctype, me.docname);
|
||||
if(me.df.options && doc[me.df.options]) {
|
||||
if(me.docname) {
|
||||
var doc = frappe.model.get_doc(me.doctype, me.docname);
|
||||
}
|
||||
if(doc && me.df.options && doc[me.df.options]) {
|
||||
me.$img = $("<img src='"+doc[me.df.options]+"' style='max-width: 100%;'>")
|
||||
.appendTo(me.$body);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@ frappe.form.formatters = {
|
|||
Date: function(value) {
|
||||
return value ? dateutil.str_to_user(value) : "";
|
||||
},
|
||||
Datetime: function(value) {
|
||||
return value ? dateutil.str_to_user(value) : "";
|
||||
},
|
||||
Text: function(value) {
|
||||
if(value) {
|
||||
var tags = ["<p", "<div", "<br"];
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ frappe.ui.TreeNode = Class.extend({
|
|||
if(this.expandable) {
|
||||
icon_html = '<i class="icon-fixed-width icon-folder-close text-muted"></i>';
|
||||
}
|
||||
$(icon_html + ' <a class="tree-label grey h6">' + this.label + "</a>").
|
||||
$(icon_html + ' <a class="tree-label grey h6">' + __(this.label) + "</a>").
|
||||
appendTo(this.$a);
|
||||
|
||||
this.$a.find('i').click(function() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue