Activating et2_IDetachedDOM implementation of et2_image widget as image and progressbar are now to seperate widgets

This commit is contained in:
Andreas Stöckel 2011-09-08 19:36:48 +00:00
parent 115d677113
commit 57dc999881

View File

@ -21,7 +21,7 @@
/** /**
* Class which implements the "image" XET-Tag * Class which implements the "image" XET-Tag
*/ */
var et2_image = et2_baseWidget.extend(/*et2_IDetachedDOM,*/ { var et2_image = et2_baseWidget.extend(et2_IDetachedDOM, {
attributes: { attributes: {
"src": { "src": {
@ -95,23 +95,15 @@ var et2_image = et2_baseWidget.extend(/*et2_IDetachedDOM,*/ {
this.options.src = _value; this.options.src = _value;
// Check whether "src" is a percentage // Get application to use from template ID
if (this.percentagePreg.test(_value)) var src = egw.image(_value, this.getTemplateApp());
if(src)
{ {
this.getSurroundings().prependDOMNode(document.createTextNode(_value)); this.image.attr("src", src).show();
} }
else else
{ {
// Get application to use from template ID this.image.css("display","none");
var src = egw.image(_value, this.getTemplateApp());
if(src)
{
this.image.attr("src", src).show();
}
else
{
this.image.css("display","none");
}
} }
}, },
@ -119,21 +111,17 @@ var et2_image = et2_baseWidget.extend(/*et2_IDetachedDOM,*/ {
* Implementation of "et2_IDetachedDOM" for fast viewing in gridview * Implementation of "et2_IDetachedDOM" for fast viewing in gridview
*/ */
// Does currently not work for percentages, as the surroundings manager getDetachedAttributes: function(_attrs) {
// cannot opperate on other DOM-Nodes.
/* getDetachedAttributes: function(_attrs) {
_attrs.push("src", "label"); _attrs.push("src", "label");
}, },
getDetachedNodes: function() { getDetachedNodes: function() {
return [this.node, this.image[0]]; return [this.image[0]];
}, },
setDetachedAttributes: function(_nodes, _values) { setDetachedAttributes: function(_nodes, _values) {
// Set the given DOM-Nodes // Set the given DOM-Nodes
this.node = _nodes[0]; this.image = $j(_nodes[0]);
this.image = $j(_nodes[1]);
this.transformAttributes(_values); this.transformAttributes(_values);
@ -147,7 +135,7 @@ var et2_image = et2_baseWidget.extend(/*et2_IDetachedDOM,*/ {
{ {
this.set_label(_values["label"]); this.set_label(_values["label"]);
} }
}*/ }
}); });
et2_register_widget(et2_image, ["image"]); et2_register_widget(et2_image, ["image"]);