TickTackk
Well-known member
- Affected version
- XF 2.2.2
HTML:
<xf:radiorow name="xyz_option_input" value="radio_b"
label="{{ phrase('xyz_option') }}">
<xf:option value="radio_a"
label="{{ phrase('xyz_option.a') }}"
data-hide="true"
data-xf-init="disabler"
data-container=".xyz_option_a" />
<xf:option value="radio_b"
label="{{ phrase('xyz_option.b') }}"
data-hide="true"
data-xf-init="disabler"
data-container=".xyz_option_b" />
</xf:radiorow>
<div class="xyz_option_a">
<xf:codeeditorrow name="xyz_option_a_contents" value="{$item.option_a_contents}"
mode="less"
class="codeEditor--autoSize"
label="{{ phrase('xyz_option_a_editor_name') }}" />
</div>
<div class="xyz_option_b">
<xf:editorrow name="xyz_option_b_contents"
value="{$item.option_b_contents}"
attachments="{{ $attachmentData ? $attachmentData.attachments : [] }}"
label="{{ phrase('xyz_option_b_editor_name') }}" />
</div>
In the above template code, if the radio value is set to
radio_b
and then the visitor switches it to radio_a
, the <xf:codeditorrow />
will not be initialized because XF.Disabler
does not trigger any custom events on the containers (.xyz_option_a
and .xyz_option_b
) and XF.CodeEditor
is specifically listening to these events toggle:shown overlay:showing tab:shown
to be triggered on the <xf:codeeditor />
.Changing
JavaScript:
if (this.options.hide)
{
if (init)
{
$container.show();
}
else
{
var cb = function()
{
XF.layoutChange();
select();
};
$container.slideDown(speed, cb);
}
XF.layoutChange();
}
else if (!init)
{
select();
}
}
else
{
if (this.options.hide)
{
if (init)
{
$container.hide();
}
else
{
$container.slideUp(speed, XF.layoutChange);
}
XF.layoutChange();
}
JavaScript:
if (this.options.hide)
{
if (init)
{
$container.show();
}
else
{
var cb = function()
{
XF.layoutChange();
select();
};
$container.slideDown(speed, cb);
}
$container.trigger('toggle:shown');
XF.layoutChange();
}
else if (!init)
{
select();
}
}
else
{
if (this.options.hide)
{
if (init)
{
$container.hide();
}
else
{
$container.slideUp(speed, XF.layoutChange);
}
$container.trigger('toggle:hidden');
XF.layoutChange();
}
form.js
seems to fix the issue.