Created
December 2, 2016 15:40
-
-
Save kdes70/f7d9f0bdb943ede5b41a339b053af4a4 to your computer and use it in GitHub Desktop.
select - выпадающий список с выделением цветом родительской категории
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label for="">Rubric</label> | |
<select name="category_id" id="category_id" class="ui dropdown"> | |
<option class="item" value="" disabled selected="">Выберите категорию...</option> | |
@foreach($categories as $item) | |
@if($item->children->count() > 0) | |
<option class="item select-option-label" value="{{$item->id}}">{{ $item->name }}</option> | |
@foreach($item->children as $submenu) | |
<option class="item" value="{{$submenu->id}}">- {{ $submenu->name }}</option> | |
@endforeach | |
@else | |
<option class="item" value="{{$item->id}}" label="{{ $item->name }}" ></option> | |
@endif | |
@endforeach | |
</select> | |
<style> | |
.select-option-label { | |
background: $base-default-color none repeat scroll 0% 50%; | |
-moz-background-clip: -moz-initial; | |
-moz-background-origin: -moz-initial; | |
-moz-background-inline-policy: -moz-initial; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment