Javascript call to expand/collapse toggles not working

This forum is for discussions on the Help & Manual Premium Pack and the Premium Pack Toolbox configuration utility introduced with Premium Pack 3

Moderators: Alexander Halser, Tim Green

Post Reply
Mark Wilsdorf
Posts: 151
Joined: Thu Dec 24, 2009 8:41 pm
Contact:

Javascript call to expand/collapse toggles not working

Unread post by Mark Wilsdorf »

Posting the the PP forum because I thought this might be due to a skin interaction. (Using 3.15 Premium skins...)

I've added a scriptlink to my WebHelp output, which results in this HTML in the output page:

Code: Select all

<p class="p_T_BtnCmd" style="page-break-inside: avoid;"><span class="f_T_BtnCmd"><a href="javascript:HMToggleExpandAll(!HMTogglesAllExpanded)" class="scriptlink" title="Show/hide expandible topics">Expand/Collapse&nbsp;all&nbsp;Topics</a></span></p>
...but nothing happens if the link gets clicked. I've also tried adding this as a button-type link, etc. Still doesn't work, in Chrome nor Firefox.

The Show/Hide options in the hamburger menu work fine (though I note they apparently use a different call, via an onclick handler).

What do I need to do differently?
Mark Wilsdorf
Posts: 151
Joined: Thu Dec 24, 2009 8:41 pm
Contact:

Re: Javascript call to expand/collapse toggles not working

Unread post by Mark Wilsdorf »

Solved I think...

I was able to make the same call as in the hamburger menu and it works fine...

Code: Select all

<p class="p_T_BtnCmd" style="page-break-inside: avoid;"><span class="f_T_BtnCmd"><a href="javascript:hmWebHelp.extFuncs('hmDoToggle',{method: 'hmToggleToggles', obj: {speed: 80}});" class="scriptlink" title="Show/hide expandible topics">Expand/Collapse&nbsp;all&nbsp;Topics</a></span></p>
...might be something to note in skins documentation? (Unless it's there & I simply missed it).
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Javascript call to expand/collapse toggles not working

Unread post by Tim Green »

Hi Mark,

Yes, this does need to be added to the documentation. It's a different call because it works differently to the version in the standard skins. Among other things, the toggle script is not there until it has been called for the first time -- the extFuncs call looks in its object to see if it has that function and if it doesn't, it loads it before calling it. Thanks for noting it. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply