Commit 85c2e7b75abc9e5bb67c4e6364b0a0666b40a5a9
1 parent
8e037b34
made conditional usage handle friendly names better in the current
environment. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3800 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
12 additions
and
1 deletions
presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js
| ... | ... | @@ -115,8 +115,19 @@ function popStack(fieldset) { |
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | 117 | function createFixedWidget(fieldset, widget, i_name, i_value, i_label) { |
| 118 | + // bad, but there's nothing else we can do in the current design. | |
| 119 | + // we need to walk the TR for the TH (widget.tagName == TR) | |
| 120 | + if (widget.tagName != 'TR') | |
| 121 | + { | |
| 122 | + // alert('Invalid widget in conditional.'+widget); | |
| 123 | + simpleLog('ERROR','invalid widget in conditional.'); | |
| 124 | + return false; | |
| 125 | + } | |
| 126 | + var header = widget.getElementsByTagName('TH')[0]; // FIXME _could_ fail if pathalogical. | |
| 127 | + var i_friendly_name = scrapeText(header); | |
| 128 | + | |
| 118 | 129 | var newWidget = TR({'class':'widget fixed'}, |
| 119 | - TH(null, i_name), | |
| 130 | + TH(null, i_friendly_name), | |
| 120 | 131 | TD(null, |
| 121 | 132 | INPUT({'type':'hidden','name':i_name, 'value':i_value,'class':'fixed'}), |
| 122 | 133 | SPAN(null, i_label) | ... | ... |