diff --git a/src/common.js b/src/common.js index 2e0adfd04f..4a30b6c11e 100644 --- a/src/common.js +++ b/src/common.js @@ -2762,7 +2762,7 @@ }, get_icon_url: function(icon_name) { if (!icon_name) { - return; + return jQuery.when(''); } return this.register_icon(icon_name).then(function() { if (icon_name in this.loaded_icons) { diff --git a/src/view/form.js b/src/view/form.js index bae3f3fe96..e6169143d7 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -865,7 +865,11 @@ function eval_pyson(value){ } Sao.common.ICONFACTORY.get_icon_url(name) .done(function(url) { - this.img.attr('src', url); + if (url) { + this.img.attr('src', url); + } else { + this.img.removeAttr('src'); + } }.bind(this)); } }); diff --git a/src/view/tree.js b/src/view/tree.js index f4f7576928..cdc3b5601f 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -1570,7 +1570,11 @@ } else { img_tag = cell; } - img_tag.attr('src', url || ''); + if (url) { + img_tag.attr('src', url); + } else { + img_tag.removeAttr('src'); + } }.bind(this)); } else { value = this.attributes.string || '';