Browse Source

update filter button

jqh 5 years ago
parent
commit
0990b49cd1
2 changed files with 3 additions and 5 deletions
  1. 2 2
      resources/views/filter/button.blade.php
  2. 1 3
      src/Grid/Tools/FilterButton.php

+ 2 - 2
resources/views/filter/button.blade.php

@@ -1,6 +1,6 @@
-<div class="btn-group" style="margin-right:3px">
+<div class="btn-group filter-button-group" style="margin-right:3px">
     <label class="btn btn-primary {{ $btn_class }} btn-sm" @if($show_filter_text)data-toggle="dropdown"@endif>
-        <i class=" ti-filter"></i>@if(!$show_filter_text)<span class="hidden-xs">&nbsp;&nbsp;{{ trans('admin.filter') }}</span>@endif
+        <i class=" ti-filter"></i>@if($show_filter_text)<span class="hidden-xs">&nbsp;&nbsp;{{ trans('admin.filter') }}</span>@endif
     </label>
     @if($scopes->isNotEmpty())
         <button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown">

+ 1 - 3
src/Grid/Tools/FilterButton.php

@@ -92,15 +92,13 @@ JS
 
         $this->setupScripts();
 
-        $showText = ((!$filters || $this->grid->option('show_filter') === false) && !$scopres->isEmpty()) ? true : false;
-
         $variables = [
             'scopes'           => $scopres,
             'current_label'    => $this->getCurrentScopeLabel(),
             'url_no_scopes'    => $filter->urlWithoutScopes(),
             'btn_class'        => $this->getElementClassName(),
             'expand'           => $filter->expand,
-            'show_filter_text' => $showText,
+            'show_filter_text' => true,
         ];
 
         return view($this->view, $variables)->render();