From 28a4c7c3c1249e9feb5fcc8b44fb5a569d476d9e Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 13 Feb 2013 09:04:17 +0000 Subject: [PATCH] Implement set_Value() for labels --- etemplate/js/et2_widget_description.js | 38 ++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/etemplate/js/et2_widget_description.js b/etemplate/js/et2_widget_description.js index a9a4cacd4c..93ad0a5990 100644 --- a/etemplate/js/et2_widget_description.js +++ b/etemplate/js/et2_widget_description.js @@ -111,6 +111,25 @@ var et2_description = et2_baseWidget.extend([et2_IDetachedDOM], { } }, + set_Value: function(_value) { + et2_insertLinkText(this._parseText(_value), + this.span[0], + this.options.extra_link_target + ); + if(this.options.extra_link_popup) + { + var href = this.options.href; + var title = this.options.extra_link_title; + var popup = this.options.extra_link_popup; + jQuery('a',_nodes[0]) + .click(function(e) { + egw.open_link(href, title,popup); + e.preventDefault(); + return false; + }); + } + }, + _parseText: function(_value) { if (this.options.href) { @@ -173,23 +192,8 @@ var et2_description = et2_baseWidget.extend([et2_IDetachedDOM], { if (typeof _values["value"] != "undefined" || (updateLink && (_values["value"] || this.options.value))) { - et2_insertLinkText(this._parseText( - _values["value"] ? _values["value"] : this.options.value), - _nodes[0], - this.options.extra_link_target - ); - if(this.options.extra_link_popup) - { - var href = this.options.href; - var title = this.options.extra_link_title; - var popup = this.options.extra_link_popup; - jQuery('a',_nodes[0]) - .click(function(e) { - egw.open_link(href, title,popup); - e.preventDefault(); - return false; - }); - } + this.span = jQuery(_nodes[0]); + this.set_Value(_values["value"]); } if (typeof _values["class"] != "undefined")