Commit 1bf085ea authored by Ujvari Gergely's avatar Ujvari Gergely

Test version: search results are loaded back and shown.

parent 2265b3d3
......@@ -51,8 +51,8 @@ class Hypothesis extends Annotator
viewer:
addField: (-> )
this.$inject = ['$document', '$filter', '$location', '$rootScope', '$route', 'drafts']
constructor: ($document, $filter, $location, $rootScope, $route, drafts) ->
this.$inject = ['$document', '$filter', '$location', '$rootScope', '$route', '$timeout', 'drafts']
constructor: ($document, $filter, $location, $rootScope, $route, $timeout, drafts) ->
Gettext.prototype.parse_locale_data annotator_locale_data
super ($document.find 'body')
......@@ -257,9 +257,21 @@ class Hypothesis extends Annotator
clearSearch: (original) =>
@show_search = false
original()
unless typeof(localStorage) is 'undefined'
try
localStorage.setItem "hyp_page_search_query", ""
catch error
console.warn 'Cannot save query to localStorage!'
if error is DOMException.QUOTA_EXCEEDED_ERR
console.warn 'localStorage quota exceeded!'
$location.path('/viewer')
$rootScope.$digest()
if search_query.length > 0
$timeout =>
@visualSearch.searchBox.searchEvent('')
, 1500
_setupXDM: ->
$location = @element.injector().get '$location'
$rootScope = @element.injector().get '$rootScope'
......
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