From f26822c302e2621b99570e71bb47e8ff8dfc360f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 12 Mar 2012 22:32:13 +0000 Subject: [PATCH] Slightly more efficient link display in datagrid; treat false and null titles as empty string --- etemplate/js/et2_widget_link.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index 1712d56e03..2a02632019 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -685,6 +685,7 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM], { * Used as a callback, so node is provided to make sure we get the right one */ set_title: function(node, _value) { + if(_value === false || _value === null) _value = ""; jQuery(node).text(_value+""); }, @@ -717,7 +718,15 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM], { */ setDetachedAttributes: function(_nodes, _values) { this.link = $j(_nodes[0]); - this.set_value(_values["value"]); + if(typeof _values["value"] !== "undefined" && typeof _values["value"].title !== "undefined") + { + // Direct route + this.set_title(_nodes[0], _values["value"].title); + } + else + { + this.set_value(_values["value"]); + } } });