Commit 57827351 authored by Ujvari Gergely's avatar Ujvari Gergely Committed by gergely-ujvari

Searchfilter handles empty query

parent ed4a2b9e
...@@ -19,9 +19,6 @@ class SearchFilter ...@@ -19,9 +19,6 @@ class SearchFilter
tokens tokens
generateFacetedFilter: (searchtext) -> generateFacetedFilter: (searchtext) ->
return unless searchtext
terms = @_tokenize(searchtext)
any = [] any = []
quote = [] quote = []
result = [] result = []
...@@ -31,6 +28,8 @@ class SearchFilter ...@@ -31,6 +28,8 @@ class SearchFilter
uri = [] uri = []
user = [] user = []
if searchtext
terms = @_tokenize(searchtext)
for term in terms for term in terms
filter = term.slice 0, term.indexOf ":" filter = term.slice 0, term.indexOf ":"
unless filter? then filter = "" unless filter? then filter = ""
...@@ -76,6 +75,7 @@ class SearchFilter ...@@ -76,6 +75,7 @@ class SearchFilter
when 'uri' then uri.push term[4..] when 'uri' then uri.push term[4..]
when 'user' then user.push term[5..] when 'user' then user.push term[5..]
else any.push term else any.push term
any: any:
terms: any terms: any
operator: 'and' operator: 'and'
......
...@@ -783,7 +783,6 @@ class ViewFilter ...@@ -783,7 +783,6 @@ class ViewFilter
# #
# Returns the list of matching annotation IDs. # Returns the list of matching annotation IDs.
filter: (annotations, query) => filter: (annotations, query) =>
return [] unless query.query
filters = @searchfilter.generateFacetedFilter query.query filters = @searchfilter.generateFacetedFilter query.query
results = [] results = []
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
color: $gray; color: $gray;
&.simple-search-inactive { &.simple-search-inactive {
color: $grayLighter; color: $gray-lighter;
} }
} }
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
padding-left: 2em; padding-left: 2em;
.simple-search-inactive & { .simple-search-inactive & {
background-color: $grayLightest; background-color: $gray-lightest;
border-color: $grayLightest !important; border-color: $gray-lightest !important;
} }
} }
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
top: 50%; top: 50%;
border: none; border: none;
border-radius: 50%; border-radius: 50%;
background: $grayLight; background: $gray-light;
color: #fff; color: #fff;
width: 16px; width: 16px;
height: 16px; height: 16px;
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
&:focus, &:hover, &:active:not([disabled]) { &:focus, &:hover, &:active:not([disabled]) {
@include transition(background-color 200ms ease-in); @include transition(background-color 200ms ease-in);
background-color: $grayLight; background-color: $gray-light;
color: #fff; color: #fff;
border: none; border: none;
background-image: none; background-image: none;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment