Compare commits

..

No commits in common. "ebd3a65096b7d772e787832b475103dae00b6d36" and "5dff9d627aa879194def98fa5425a8c3894446b3" have entirely different histories.

View File

@ -17,6 +17,8 @@
</div>
<div class="card-body">
<form class="row form" method="GET" action="">
<input type="hidden" name="sort" value="{{ request('sort', 'park_id') }}">
<input type="hidden" name="order" value="{{ request('order', 'asc') }}">
<div class="w-100 alert alert-success">
<h6><a class="text-success" data-toggle="collapse" href="#search-option" role="button"
aria-expanded="false" aria-controls="search-option">絞込み条件を追加する</a></h6>
@ -55,13 +57,25 @@
<table id="searchTable" class="tablesorter table table-striped">
<thead>
<tr>
<th class="header" style="cursor:default; pointer-events: none; background-color: #d4edda !important;">駐輪場名</th>
<th class="header" style="cursor:default; pointer-events: none;">市町村名</th>
<th class="header" style="cursor:default; pointer-events: none;">駅名</th>
<th class="header" style="cursor:default; pointer-events: none;">自転車</th>
<th class="header" style="cursor:default; pointer-events: none;">原付</th>
<th class="header" style="cursor:default; pointer-events: none;">自動二輪</th>
<th class="header" style="cursor:default; pointer-events: none;">自動車</th>
<th class="header">
駐輪場名
<a href="{{ request()->fullUrlWithQuery(['sort' => 'park_ruby', 'order' => 'asc', 'page' => 1]) }}" class="text-success"><i class="bi bi-caret-up-fill"></i></a>
<a href="{{ request()->fullUrlWithQuery(['sort' => 'park_ruby', 'order' => 'desc', 'page' => 1]) }}" class="text-success"><i class="bi bi-caret-down-fill"></i></a>
</th>
<th class="header">
市町村名
<a href="{{ request()->fullUrlWithQuery(['sort' => 'city_id', 'order' => 'asc', 'page' => 1]) }}" class="text-success"><i class="bi bi-caret-up-fill"></i></a>
<a href="{{ request()->fullUrlWithQuery(['sort' => 'city_id', 'order' => 'desc', 'page' => 1]) }}" class="text-success"><i class="bi bi-caret-down-fill"></i></a>
</th>
<th class="header">
駅名
<a href="{{ request()->fullUrlWithQuery(['sort' => 'station_name_ruby', 'order' => 'asc', 'page' => 1]) }}" class="text-success"><i class="bi bi-caret-up-fill"></i></a>
<a href="{{ request()->fullUrlWithQuery(['sort' => 'station_name_ruby', 'order' => 'desc', 'page' => 1]) }}" class="text-success"><i class="bi bi-caret-down-fill"></i></a>
</th>
<th class="header">自転車</th>
<th class="header">原付</th>
<th class="header">自動二輪</th>
<th class="header">自動車</th>
</tr>
</thead>
<tbody>
@ -188,4 +202,16 @@
</div>
</div>
</div>
<script>
document.querySelectorAll('#searchTable th a, #searchTable .header a').forEach(function(el) {
el.addEventListener('click', function(e) {
// サーバーに遷移させる
window.location.href = el.href;
// 既存のJSによるイベントを止める
e.stopImmediatePropagation();
e.preventDefault();
return false;
}, true); // trueでキャプチャフェーズに
});
</script>
@endsection