Closing Drop-downs

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
panda
Propeller Head
Posts: 30
Joined: Thu Apr 10, 2008 11:29 am

Closing Drop-downs

Post by panda »

Some of my drop-downs are rather long, and I would like to be able to put a control at the end to close it up again, rather than the user having to scroll back to where they were - please, is there a way of doing this?
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Closing Drop-downs

Post by Andrew »

Yes, you can do it with some JavaScript. It's not as simply as it could be, since you can't name the drop-down element (like you can with togglers) -- Flare removes any name you apply to the MadCap:dropDownBody element when it builds the output (replaces that whole tag with a set of div elements). Flare does use unique id properties, but I'm not sure exactly how they are generated, and to make the script "hardened" against any changes to your help, you'd have to use JavaScript to figure out the id for the div that contains your current drop-down.

I'm sorry I can't be more helpful; I don't have the time to investigate and script some kind of solution at the moment. Hopefully someone else on the forum with more JavaScript experience can help (or perhaps you have a developer in your organization who can help you with JavaScript).
Flare v6.1 | Capture 4.0.0
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Closing Drop-downs

Post by i-tietz »

With javascript, yes. But you gotta know your way around the object model of the browser(s) and with javascript. If you know somebody to do that:

You can retrieve the id of the dropdownhotspot of the current dropdown. Then you send a "click" - as if the user had clicked on the dropdownhotspot.
You trigger this javascript with a link at the bottom of the dropdown.
You stuff that link into a snippet which you insert - unchanged, means not converted to text - into those dropdowns.
You have to give this link a specific class or id to identify it and rewrite the action onload of the document, because the ids of the ddhotspots are determined during the building of the help - means: You cannot add the precise link before.
Inge____________________________
"I need input! - Have you got input?"
nickatwork
Sr. Propeller Head
Posts: 457
Joined: Thu Sep 16, 2010 6:31 am
Location: London

Re: Closing Drop-downs

Post by nickatwork »

Could you use the expand all/collapse all options in the top menu items? maybe not ideal, but a temp fix?
Craig.Prichard
Propeller Head
Posts: 62
Joined: Sat Dec 10, 2005 8:06 pm
Location: Calgary, AB Canada

Re: Closing Drop-downs

Post by Craig.Prichard »

I have an instance of the Expand All / Collapse All toolbar buttons in a footer snippet on my MasterPage. It's an "all or nothing" solution but was much quicker to implement that javascript.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Closing Drop-downs

Post by i-tietz »

mmmhh ... as a user I would be angry about both things: scroll up to close it or have all dropdowns closed if I don't want it ...
IMHO you switch from one bug to another ...
Inge____________________________
"I need input! - Have you got input?"
Post Reply