Commit a5016d5b authored by Ujvari Gergely's avatar Ujvari Gergely

Handle spaces in tags

The tag-it library is now configured to allow spaces.
However by default the window.open() function converts
the space characters in the query part of the uri to +
The streamsearch controller is now handling this conversion too.

Fixes #1254
parent 55d41c5b
...@@ -271,6 +271,7 @@ tags = ['$window', ($window) -> ...@@ -271,6 +271,7 @@ tags = ['$window', ($window) ->
caseSensitive: false caseSensitive: false
placeholderText: attr.placeholder placeholderText: attr.placeholder
keepPlaceholder: true keepPlaceholder: true
allowSpaces: true
preprocessTag: (val) -> preprocessTag: (val) ->
val.replace /[^a-zA-Z0-9\-\_\s]/g, '' val.replace /[^a-zA-Z0-9\-\_\s]/g, ''
afterTagAdded: (evt, ui) -> afterTagAdded: (evt, ui) ->
......
...@@ -177,7 +177,12 @@ class StreamSearch ...@@ -177,7 +177,12 @@ class StreamSearch
a_upd.getTime() - b_upd.getTime() a_upd.getTime() - b_upd.getTime()
# Read search params # Read search params
$scope.query = $location.search() search = $location.search()
for k,v of search
if '+' in v
search[k] = v.replace /\+/g, ' '
$scope.query = search
$scope.searchFacets = SEARCH_FACETS $scope.searchFacets = SEARCH_FACETS
$scope.searchValues = SEARCH_VALUES $scope.searchValues = SEARCH_VALUES
......
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