Hi,
recently encountered that the images in et2 do not support the onclick
event at the moment. This is needed, e.g. for addressbook image
uploading. I enabled it by doing so:
+++ etemplate/js/et2_widget_image.js (working copy)
@@ -54,19 +54,28 @@
“name”: “Label”,
“type”: “string”,
“description”: “Label for image”
-
},
-
"onclick": {
-
"name": "onclick",
-
"type": "string",
-
"description": "JS code which gets executed when the image is clicked"
-
},
},
legacyOptions: [“href”, “extra_link_target”, “imagemap”,
“extra_link_popup”, “id”],
init: function() {
this._super.apply(this, arguments);
// Create the image or a/image tag
this.image = $j(document.createElement(“img”));
if (this.options.label)
{
this.image.attr(“alt”, this.options.label).attr(“title”,
this.options.label);
}
-
if(this.options.onclick)
-
{
-
this.image.attr('onclick', this.options.onclick);
-
}
if (this.options.href)
{
this.image.addClass('et2_clickable');
Is this the right way? I saw a “click()” method in the base widget which
executes the “onclick()” method for the widget if present. Seems to me
that the plan for clicking a widget is another one than just setting the
onclick attribute like I did it now.
Thanks.
Bye
Christian
Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers