fix in image view

This commit is contained in:
Neil Trini Lasrado 2015-02-10 15:45:27 +05:30
parent 9035c30492
commit 4447515c5a

View file

@ -127,10 +127,13 @@ frappe.ui.form.ControlImage = frappe.ui.form.Control.extend({
.css({"max-width": "600px", "margin": "0px"});
this.$body = $("<div></div>").appendTo(this.$wrapper)
.css({"margin-bottom": "10px", "max-width": "100%"})
this.$wrapper.on("refresh", function() {
me.$body.empty();
if(me.df.options && me.frm.doc[me.df.options]) {
me.$img = $("<img src='"+me.frm.doc[me.df.options]+"' style='max-width: 100%;'>")
var doc = frappe.model.get_doc(me.doctype, me.docname);
if(me.df.options && doc[me.df.options]) {
me.$img = $("<img src='"+doc[me.df.options]+"' style='max-width: 100%;'>")
.appendTo(me.$body);
} else {
me.$buffer = $("<div class='missing-image'><i class='octicon octicon-circle-slash'></i></div>")