localStorage == null in wh_topic page

<oXygen/> general issues.
revaljilji
Posts: 3
Joined: Mon Sep 09, 2019 3:07 pm

localStorage == null in wh_topic page

Post by revaljilji » Wed Dec 04, 2019 12:24 pm

I added two buttons to wh_tools element which will help user to go directly to results of the last search and show them instead the toc menu. I used localStorage/sessionStorage to save the HTML results in displayPageResults() function in search.js. Upon loading the wh_topic page, I use getter and get the item I saved and asign the action to the buttons 'Suchergebnisse' (which will change the toc menu to search results picture 2) and 'Inhalt' (which will bring the toc menu back picture 1). This works fine and the localStorage contains the value of the search HTML, but it works only for the first topic (in this case FOO1 picture 1). When I click any other, the localStorage with that key is equal to null. Going back to first topic again would work. Do you maybe know the reason behind this or maybe is there another aproach to this?

Edit: Just found out that this was the standard feature with webhelp classic. Is there a way to activate/add it for the wh responsive too?
FOO1_TOC.PNG
FOO1_TOC.PNG (4.68 KiB) Viewed 19 times
FOO_SEARCH.PNG
FOO_SEARCH.PNG (9.01 KiB) Viewed 19 times
Attachments
image.png
image.png (8.36 KiB) Viewed 19 times