fix roles
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
@if(empty($name))
|
||||
<code><x-boilerplate::select2> The name attribute has not been set</code>
|
||||
@else
|
||||
<div class="form-group">
|
||||
<div class="form-group{{ isset($groupClass) ? ' '.$groupClass : '' }}"{!! isset($groupId) ? ' id="'.$groupId.'"' : '' !!}>
|
||||
@isset($label)
|
||||
{{ Form::label($name, __($label)) }}
|
||||
<label for="{{ $id }}">{!! __($label) !!}</label>
|
||||
@endisset
|
||||
<select id="{{ $id }}" name="{{ $name }}" class="form-control{{ $errors->first($name,' is-invalid') }}{{ isset($class) ? ' '.$class : '' }}"{!! !empty($attributes) ? ' '.$attributes : '' !!} style="visibility:hidden;height:1rem">
|
||||
<select id="{{ $id }}" name="{{ $name }}" class="form-control{{ $errors->first($name,' is-invalid') }}{{ isset($class) ? ' '.$class : '' }}"{!! !empty($attributes) ? ' '.$attributes : '' !!} style="visibility:hidden;height:1rem" autocomplete="off">
|
||||
@if(!isset($multiple))
|
||||
<option></option>
|
||||
@endif
|
||||
@@ -24,10 +24,11 @@
|
||||
<div class="error-bubble"><div>{{ $message }}</div></div>
|
||||
@enderror
|
||||
</div>
|
||||
@include('boilerplate::load.select2')
|
||||
@push('js')
|
||||
@include('boilerplate::load.async.select2')
|
||||
@component('boilerplate::minify')
|
||||
<script>
|
||||
$(function () {
|
||||
whenAssetIsLoaded('select2', () => {
|
||||
let parent = $('#{{ $id }}').parent();
|
||||
$('#{{ $id }}').select2({
|
||||
placeholder: '{{ $placeholder ?? '—' }}',
|
||||
allowClear: {{ $allowClear }},
|
||||
@@ -36,15 +37,17 @@
|
||||
minimumInputLength: {{ $minimumInputLength ?? 0 }},
|
||||
minimumResultsForSearch: {{ $minimumResultsForSearch ?? 10 }},
|
||||
width: '100%',
|
||||
@isset($ajax)
|
||||
dropdownAutoWidth: true,
|
||||
dropdownParent: parent,
|
||||
@isset($ajax)
|
||||
ajax: {
|
||||
delay: 200,
|
||||
url: '{{ $ajax }}',
|
||||
method: 'post'
|
||||
}
|
||||
@endisset
|
||||
});
|
||||
});
|
||||
@endisset
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@endif
|
||||
@endcomponent
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user