From 499726cb2395e170a34b9ffc121a0145fad237f4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 31 Aug 2011 06:29:51 +0000 Subject: [PATCH] using egw.image(), thought there are some problems: - src attribute get never translated: fixed - label is in etemplate not the alt attribute, it is a title / tooltip (probably ok as alt too) - egw.image should be called with appname part of template - if image is not found, etemplate should render an empty widget, not a broken one --- etemplate/js/et2_widget_image.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etemplate/js/et2_widget_image.js b/etemplate/js/et2_widget_image.js index 756ef8f354..11dfde90c7 100644 --- a/etemplate/js/et2_widget_image.js +++ b/etemplate/js/et2_widget_image.js @@ -26,8 +26,7 @@ var et2_image = et2_baseWidget.extend({ "src": { "name": "Image", "type": "string", - "description": "Displayed image", - "translate": "!no_lang" + "description": "Displayed image" }, "link": { }, @@ -57,13 +56,14 @@ var et2_image = et2_baseWidget.extend({ set_label: function(_value) { if(_value == this.options.label) return; this.options.label = _value; + // label is NOT the alt attribute in eTemplate, but the title/tooltip this.image.attr("alt", _value); }, set_src: function(_value) { - console.log("IMAGE ", _value); this.options.src = _value; - this.image.attr("src", _value); + // using current app (default) is not exactly right, it should be the app of the template, eg. "addressbook" for "addressbook.edit" + this.image.attr("src", egw.image(_value, egw_appName) || _value); } });