Copy link to clipboard
Copied
Does anyone know of a way to create a button or link that shows or hides all expanding and drop-down links in a WebHelp topic when the topic is opened *outside* of the traditional tri-pane view? I know that Peter Grainge has a solution to this on his site, but it assumes the tri-pane view is being used, which is probably true for almost all RoboHelp users. We, however, open help topics outside of that view, so I am looking for a solution that doesn't require a button in the skin.
I did look at the toggle.js Javascript file provided on Peter Grainge's site, but I was unsure how to change the lines that assume the presence of the bsscright frame.
Thanks,
Tammy
Hi,
The problem is that there is a function 'show' in whtopic.js that conflicts with the variable in the script. Rename the variable 'show' and all occurances to something like 'isshown' to fix the script.
Greet,
Willam
Copy link to clipboard
Copied
My apologies - I was focused on the problem and forgot to mention that I am using RoboHelp HTML 8 and am talking here specifically about the WebHelp output.
Copy link to clipboard
Copied
Hi,
You can use the show/hide all script form my twisty method: http://www.grainge.org/pages/authoring/twisty/twisty.htm or http://www.wvanweelden.eu/robohelp/scripts/twisties_and_show_hide_all. You can use only the show/hide all buttons in your topics. This is compatible with the default RoboHelp 8 twisties.
For the toggle.js, remove :
var setFocus = parent.frames[1].bsscright;
Then, remove "setFocus." from the following lines:
var arrayofDivs = setFocus.document.getElementsByTagName('DIV');
var arrayofSpans = setFocus.document.getElementsByTagName('SPAN');
var arrayofLinks = setFocus.document.getElementsByTagName('A');
Greet,
Willam
Copy link to clipboard
Copied
Thank you, William!
Copy link to clipboard
Copied
There are other references to bsscright and to setFocus in the file. Should I remove all of those as well?
I'm also not quite sure how to code the link and/or button. The methods I'm seeing assume I am not using the standard twisty method embedded in RoboHelp, but I am using that.
Tammy
Copy link to clipboard
Copied
I see now that my link works properly when I remove the additional references to the bsscright frame and the other "setFocus" references. Thanks for your help!
Copy link to clipboard
Copied
Hi,
Glad it worked. Sorry for not giving a reaction sooner, you know timezones and all that.
Greet,
Willam
Copy link to clipboard
Copied
I do unfortunately still have one problem. Now that I've removed all the "setFocus" variable references, I have to click twice on the link the first time to make it work. After that, a single click is sufficient to expand or collapse.
Copy link to clipboard
Copied
Hi,
Did you also remove parent.frames[1].bsscright.focus(); from the function?
Is the first line of the script still var show = "false";?
Greet,
Willam
Copy link to clipboard
Copied
The answer to both questions is yes - I removed the bsscright line you mentioned, and show is still set to false.
Tammy
Copy link to clipboard
Copied
Hi,
The problem is that there is a function 'show' in whtopic.js that conflicts with the variable in the script. Rename the variable 'show' and all occurances to something like 'isshown' to fix the script.
Greet,
Willam
Copy link to clipboard
Copied
Thank you, William! This works perfectly. I had traced through the code trying to find the problem but couldn't see anything wrong. I didn't think about a conflict with names used in another file. Thanks for all the work you have done on this in the past and today!
Tammy