Fixed saving query on task state.

This commit is contained in:
Martin Edenhofer 2016-07-07 07:09:48 +02:00
parent 7f1ecaa67e
commit 552988f514

View file

@ -18,6 +18,10 @@ class App.Search extends App.Controller
App.TaskManager.remove(@task_key) App.TaskManager.remove(@task_key)
return return
current = App.TaskManager.get(@task_key).state
if current && current.query
@query = current.query
# update taskbar with new meta data # update taskbar with new meta data
App.TaskManager.touch(@task_key) App.TaskManager.touch(@task_key)
@ -48,8 +52,8 @@ class App.Search extends App.Controller
show: (params) => show: (params) =>
@navupdate(url: '#search', type: 'menu') @navupdate(url: '#search', type: 'menu')
return if !params.query return if _.isEmpty(params.query)
@$('.js-search').val(decodeURIComponent(params.query)).trigger('change') @$('.js-search').val(params.query).trigger('change')
@throttledSearch(true) @throttledSearch(true)
hide: -> hide: ->
@ -188,9 +192,13 @@ class Router extends App.ControllerPermanent
constructor: (params) -> constructor: (params) ->
super super
query = undefined
if !_.isEmpty(params.query)
query = decodeURIComponent(params.query)
# cleanup params # cleanup params
clean_params = clean_params =
query: params.query query: query
App.TaskManager.execute( App.TaskManager.execute(
key: 'Search' key: 'Search'