From 57dc9998816d4f1c47d4829a469eca5268073633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Thu, 8 Sep 2011 19:36:48 +0000 Subject: [PATCH] Activating et2_IDetachedDOM implementation of et2_image widget as image and progressbar are now to seperate widgets --- etemplate/js/et2_widget_image.js | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/etemplate/js/et2_widget_image.js b/etemplate/js/et2_widget_image.js index 09d97fb4c9..736e54681b 100644 --- a/etemplate/js/et2_widget_image.js +++ b/etemplate/js/et2_widget_image.js @@ -21,7 +21,7 @@ /** * Class which implements the "image" XET-Tag */ -var et2_image = et2_baseWidget.extend(/*et2_IDetachedDOM,*/ { +var et2_image = et2_baseWidget.extend(et2_IDetachedDOM, { attributes: { "src": { @@ -95,23 +95,15 @@ var et2_image = et2_baseWidget.extend(/*et2_IDetachedDOM,*/ { this.options.src = _value; - // Check whether "src" is a percentage - if (this.percentagePreg.test(_value)) + // Get application to use from template ID + var src = egw.image(_value, this.getTemplateApp()); + if(src) { - this.getSurroundings().prependDOMNode(document.createTextNode(_value)); + this.image.attr("src", src).show(); } else { - // Get application to use from template ID - var src = egw.image(_value, this.getTemplateApp()); - if(src) - { - this.image.attr("src", src).show(); - } - else - { - this.image.css("display","none"); - } + 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 */ - // Does currently not work for percentages, as the surroundings manager - // cannot opperate on other DOM-Nodes. - -/* getDetachedAttributes: function(_attrs) { + getDetachedAttributes: function(_attrs) { _attrs.push("src", "label"); }, getDetachedNodes: function() { - return [this.node, this.image[0]]; + return [this.image[0]]; }, setDetachedAttributes: function(_nodes, _values) { // Set the given DOM-Nodes - this.node = _nodes[0]; - this.image = $j(_nodes[1]); + this.image = $j(_nodes[0]); this.transformAttributes(_values); @@ -147,7 +135,7 @@ var et2_image = et2_baseWidget.extend(/*et2_IDetachedDOM,*/ { { this.set_label(_values["label"]); } - }*/ + } }); et2_register_widget(et2_image, ["image"]);