From 85c2e7b75abc9e5bb67c4e6364b0a0666b40a5a9 Mon Sep 17 00:00:00 2001 From: Brad Shuttleworth Date: Tue, 11 Oct 2005 19:07:00 +0000 Subject: [PATCH] made conditional usage handle friendly names better in the current environment. --- presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js b/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js index bbee902..bfffdf7 100644 --- a/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js +++ b/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js @@ -115,8 +115,19 @@ function popStack(fieldset) { */ function createFixedWidget(fieldset, widget, i_name, i_value, i_label) { + // bad, but there's nothing else we can do in the current design. + // we need to walk the TR for the TH (widget.tagName == TR) + if (widget.tagName != 'TR') + { + // alert('Invalid widget in conditional.'+widget); + simpleLog('ERROR','invalid widget in conditional.'); + return false; + } + var header = widget.getElementsByTagName('TH')[0]; // FIXME _could_ fail if pathalogical. + var i_friendly_name = scrapeText(header); + var newWidget = TR({'class':'widget fixed'}, - TH(null, i_name), + TH(null, i_friendly_name), TD(null, INPUT({'type':'hidden','name':i_name, 'value':i_value,'class':'fixed'}), SPAN(null, i_label) -- libgit2 0.21.4