Highlighted

Running custom JS code when filter is selected - where to start?

Community Beginner ,
Oct 19, 2015

Copy link to clipboard

Copied

Hi there,

I want to add custom JS code that is executed each time the user selects a filter in the filter pane (RH 2015, HTML5 output). Unfortunately, most of the code dealing with the filter pane is minified (common.min.js and rh.min.js). 

Has anyone tried this before? Is there a suitable "entry point" to add custom event code for this? (Tried OnPageClick in ehlpdhtm.js, but that doesn't seem to work since the event.target doesn't change after the first click event for the filter pane is fired).

Topics

HTML

Views

215

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Running custom JS code when filter is selected - where to start?

Community Beginner ,
Oct 19, 2015

Copy link to clipboard

Copied

Hi there,

I want to add custom JS code that is executed each time the user selects a filter in the filter pane (RH 2015, HTML5 output). Unfortunately, most of the code dealing with the filter pane is minified (common.min.js and rh.min.js). 

Has anyone tried this before? Is there a suitable "entry point" to add custom event code for this? (Tried OnPageClick in ehlpdhtm.js, but that doesn't seem to work since the event.target doesn't change after the first click event for the filter pane is fired).

Topics

HTML

Views

216

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Faeneth LATEST
Explorer ,
Sep 20, 2018

Copy link to clipboard

Copied

Although this is a rather old question and the OP probably found an alternate solution by now, I'd like to offer my approach for doing this when using a HTML5 layout (from RH 2015 upward).

I have added an "onClick" attribute to the filter item <input> tags in the template's topic.slp (and homepage.slp if available) files. The onClick attribute can then call a custom JS function, with a delay if needed in order to wait until the filter change is actually applied.

This means you need to adapt the Robohelp template, which can be complicated.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...