From e980f3a85183ecd906d9dcfecaa768d968aaf97c Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 26 Jan 2021 13:09:39 -0700 Subject: [PATCH] Etemplate: if readonly radiobox has the default ro_true=X, we still need the label --- api/js/etemplate/et2_widget_radiobox.js | 6 +++++- api/js/etemplate/et2_widget_radiobox.ts | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_radiobox.js b/api/js/etemplate/et2_widget_radiobox.js index 148f07dc03..d24ed506a4 100644 --- a/api/js/etemplate/et2_widget_radiobox.js +++ b/api/js/etemplate/et2_widget_radiobox.js @@ -212,7 +212,11 @@ var et2_radiobox_ro = /** @class */ (function (_super) { } }; et2_radiobox_ro.prototype.set_label = function (_label) { - // no label for ro radio, we show label of checked option as content + // no label for ro radio, we show label of checked option as content, unless it's x + // then we need the label for things to make sense + if (this.options.ro_true == "x") { + return _super.prototype.set_label.call(this, _label); + } }; /** * Code for implementing et2_IDetachedDOM diff --git a/api/js/etemplate/et2_widget_radiobox.ts b/api/js/etemplate/et2_widget_radiobox.ts index 6498f4fd67..06a8cd1cc1 100644 --- a/api/js/etemplate/et2_widget_radiobox.ts +++ b/api/js/etemplate/et2_widget_radiobox.ts @@ -257,7 +257,12 @@ class et2_radiobox_ro extends et2_valueWidget implements et2_IDetachedDOM } set_label(_label) { - // no label for ro radio, we show label of checked option as content + // no label for ro radio, we show label of checked option as content, unless it's x + // then we need the label for things to make sense + if(this.options.ro_true == "x") + { + return super.set_label(_label); + } } /**