This commit is contained in:
ichynul 2021-05-31 23:54:03 +08:00
parent 52386ee7c3
commit e559a301a8
6 changed files with 32 additions and 17 deletions

View File

@ -29,6 +29,15 @@
width: 8px;
}
.lyear-switch input:disabled + span {
cursor: not-allowed;
background-color: #ebebeb;
}
.lyear-switch input:disabled + span::after {
opacity: .4;
}
form.search-form .form-group {
margin-bottom: 3px;
}

View File

@ -917,7 +917,12 @@ $(function () {
$(".form-control.readonly").attr('readonly', 'readonly');
$(".form-control.disabled").attr('disabled', 'disabled');
$(".form-control.not-readonly").removeAttr('readonly');
$(".form-control.not-disabled").removeAttr('disabled')
$(".form-control.not-disabled").removeAttr('disabled');
$("label.readonly input").attr('readonly', 'readonly');
$("label.disabled input").attr('disabled', 'disabled');
$("label.not-readonly input").removeAttr('readonly');
$("label.not-disabled input").removeAttr('disabled');
window.renderFiles();
});

View File

@ -603,10 +603,6 @@ class Table extends TWrapper implements Renderable
$toolbar->beforRender();
}
if ($this->useActionbar) {
$this->getActionbar()->beforRender();
}
if (empty($this->searchForm)) {
$this->getSearch();
$this->searchForm->addClass('form-empty');

View File

@ -247,7 +247,7 @@ class Items extends Field
$(this).removeAttr('name');
});
}
else if($(obj).hasClass('lyear-switch'))
else if($(obj).hasClass('switch-label'))
{
var input = $(obj).prev('input');
input.attr('data-name', input.attr('name'));
@ -277,7 +277,7 @@ class Items extends Field
});
return;
}
else if($(obj).hasClass('lyear-switch'))
else if($(obj).hasClass('switch-label'))
{
var input = $(obj).prev('input');
input.attr('data-name', input.attr('name'));
@ -298,11 +298,11 @@ class Items extends Field
$(obj).attr('id', newid);
var newName = oldName.replace(/(.+?)\[__new__\](.+?)/, '$1' + '[__new__' + i + ']$2');
console.log('oldId:'+oldId);
console.log('oldName:'+oldName);
console.log('newid:'+newid);
console.log('newName:'+newName);
console.log('-------------------------------------------');
//console.log('oldId:'+oldId);
//console.log('oldName:'+oldName);
//console.log('newid:'+newid);
//console.log('newName:'+newName);
//console.log('-------------------------------------------');
$(obj).attr('name', newName);
$(obj).removeAttr('data-name');
if($(obj).hasClass('item-field-required'))

View File

@ -1,7 +1,7 @@
{include file="$labeltempl" /}
<div class="col-md-{$size[1]} checkbox-div">
<input type="hidden" name="{$name}" id="{$id}" {$attr|raw}>
<label class="lyear-switch {$class}">
<label class="lyear-switch {$class} switch-label">
<input type="checkbox" data-on="{$pair[0]}" data-off="{$pair[1]}" class="switch-box" id="{$id}-box" {if condition="$checked" }checked{/if} {$attr|raw}>
<span></span>
</label>

View File

@ -126,10 +126,15 @@
if (window.renderFiles) {
window.renderFiles('#{$id} ');
}
$("table .form-control.readonly").attr('readonly', 'readonly');
$("table .form-control.disabled").attr('disabled', 'disabled');
$("table .form-control.not-readonly").removeAttr('readonly');
$("table .form-control.not-disabled").removeAttr('disabled')
$("#{$id} table .form-control.readonly").attr('readonly', 'readonly');
$("#{$id} table .form-control.disabled").attr('disabled', 'disabled');
$("#{$id} table .form-control.not-readonly").removeAttr('readonly');
$("#{$id} table .form-control.not-disabled").removeAttr('disabled');
$("#{$id} table label.readonly input").attr('readonly', 'readonly');
$("#{$id} table label.disabled input").attr('disabled', 'disabled');
$("#{$id} table label.not-readonly input").removeAttr('readonly');
$("#{$id} table label.not-disabled input").removeAttr('disabled');
}
</script>
</div>