diff --git a/lib/zin/wg/thinkchecklist/js/v1.js b/lib/zin/wg/thinkchecklist/js/v1.js index bb141f14d6..ad93be20db 100644 --- a/lib/zin/wg/thinkchecklist/js/v1.js +++ b/lib/zin/wg/thinkchecklist/js/v1.js @@ -23,12 +23,12 @@ window.toggleChecked = function() if($(this).hasClass('has-input')) { - $(this).find('textarea').prop('disabled', !$(this).find('input').prop('checked')); + $(this).find('textarea').toggleClass('hidden', !$(this).find('input').prop('checked')); if($(this).find('input').prop('checked')) $(this).find('textarea').trigger('focus'); } else { - if($(this).data('type') == 'radio') $(this).closest('.think-check-list').find('.has-input textarea').prop('disabled', true); + if($(this).data('type') == 'radio')$(this).closest('.think-check-list').find('.has-input textarea').addClass('hidden'); } } diff --git a/lib/zin/wg/thinkchecklist/v1.php b/lib/zin/wg/thinkchecklist/v1.php index 30455e27a6..c76147fe71 100644 --- a/lib/zin/wg/thinkchecklist/v1.php +++ b/lib/zin/wg/thinkchecklist/v1.php @@ -38,6 +38,8 @@ class thinkCheckList extends wg public function onBuildItem($item): wg|node { + global $lang; + if($item instanceof item) $item = $item->props->toJSON(); if(!isset($item['checked'])) @@ -71,10 +73,11 @@ class thinkCheckList extends wg new textarea ( set(array( - 'rows' => 1, - 'disabled' => !isset($item['checked']) || !$item['checked'], - 'name' => 'other', - 'value' => isset($item['showText']) ? $item['showText'] : '' + 'rows' => 1, + 'class' => 'hidden', + 'name' => 'other', + 'value' => isset($item['showText']) ? $item['showText'] : '', + 'placeholder' => $lang->thinkrun->placeholder->otherOption )), on::input('inputOther'), on::click('stopPropagation')