From 42e66e9319ccbd6858c1e67273a46554c8830152 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 14 Aug 2013 17:35:50 +0000 Subject: [PATCH] Fix detached label not updating --- etemplate/js/et2_widget_link.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index bb9d019de6..2b0fd1b7c5 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -991,7 +991,7 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM], * by the calling code. */ getDetachedAttributes: function(_attrs) { - _attrs.push("value"); + _attrs.push("label","value"); }, /** @@ -999,7 +999,7 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM], * passed to the "setDetachedAttributes" function in the same order. */ getDetachedNodes: function() { - return [this.node]; + return [this.node, this._labelContainer ? this._labelContainer[0] : null]; }, /** @@ -1013,8 +1013,11 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM], * given values. */ setDetachedAttributes: function(_nodes, _values) { + this.node = _nodes[0]; this.link = jQuery(_nodes[0]); + this._labelContainer = _nodes[1] != null ? jQuery(_nodes[1]) : null; if(typeof _values["id"] !== "undefined") this.set_id(_values['id']); + if(typeof _values["label"] !== "undefined") this.set_label(_values['label']); if(typeof _values["value"] !== "undefined" && typeof _values["value"].title !== "undefined") { // Direct route