* zin: modify the the interaction of input of thinkchecklist wg.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user