$this->setAttribute('auth', false);
$this->setAttribute('type', 'noteditable');
$this->setAttribute('view_namespace', CubistBackpackServiceProvider::NAMESPACE . '::fields');
- $this->setAttribute('tab',null);
- $this->setAttribute('label','');
+ $this->setAttribute('tab', null);
+ $this->setAttribute('label', '');
+ $this->setAttribute('read_only', false);
}
} else if (null !== $this->getAttribute('can_hidden', null)) {
if (!self::can($this->getAttribute('can_hidden'))) {
$this->setAttribute('auth', false);
$this->setAttribute('type', 'authhidden');
$this->setAttribute('view_namespace', CubistBackpackServiceProvider::NAMESPACE . '::fields');
- $this->setAttribute('tab',null);
- $this->setAttribute('label','');
+ $this->setAttribute('tab', null);
+ $this->setAttribute('label', '');
+ $this->setAttribute('read_only', false);
}
}
+@push('crud_fields_scripts')
+ @loadOnce('bpFieldInitNotEditable')
+ <script>
+ $(function () {
+ var isCardVisible = false;
+ $('.card').each(function () {
+ $('.card-body').each(function () {
+ if ($(this).children(':not(.hidden)').length > 0) {
+ isCardVisible = true;
+ } else {
+ $(this).hide();
+ }
+ });
+ if (!isCardVisible) {
+ $(this).hide();
+ }
+ });
+ });
+ </script>
+ @endLoadOnce
+@endpush