From aac9cd7eaca018ad3b976a27bbd024c3ead03d39 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 23 Aug 2015 23:13:28 -0700 Subject: [PATCH] Avoid using history.state.search because of problems if history.state is string. #463? --- src/General/Index.coffee | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 82cdda77c..12191621a 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -9,7 +9,7 @@ Index = name: 'Catalog Features' cb: @catalogNode - @search = history.state?.search or '' + @search = history.state?.searched or '' if history.state?.mode Conf['Index Mode'] = history.state?.mode @currentPage = @getCurrentPage() @@ -226,10 +226,10 @@ Index = popstate: (e) -> if e?.state - {search, mode} = e.state + {searched, mode} = e.state state = {} - if Index.search isnt search - state.search = Index.search = search + if Index.search isnt searched + state.search = Index.search = searched if Conf['Index Mode'] isnt mode state.mode = mode Index.saveMode mode @@ -317,9 +317,9 @@ Index = pathname = if page is 1 then "/#{g.BOARD}/" else "/#{g.BOARD}/#{page}" hash = '' history[if state.replace then 'replaceState' else 'pushState'] - mode: Conf['Index Mode'] - search: Index.search - oldpage: pageBeforeSearch + mode: Conf['Index Mode'] + searched: Index.search + oldpage: pageBeforeSearch , '', pathname + hash state