oulan / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

problem using toolbar buttons to navigate to page #221

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.create a toolbar button that leads to a page ('search' or 'about' are two
cases I can think of)
2.when using the button, the proper page opens but the toolbar button remains.
3.clicking on the button again causes undesired results.

I actually have a solution for this, whipped up in 1 minute (so it might
require improvements), that helped me on my case.
add this code to the updatePage function:

    var pageButton = $(page.id+"Button");
    if(pageButton)
    {
        pageButton.style.display = "none";
    }   

    if(fromPage != null)
    {
        var fromPageButton = $(fromPage.id+"Button");
        if(fromPageButton)
        {
            fromPageButton.style.display = "inline";
        }       
    }

this will automatically take care toolbar buttons that have an id
indicating the relevant page in the form pagenameButton. e.g.: 
<a id="aboutButton" class="button" href="#about">About</a>

buttons that do not have proper ids will simply be ignored by the script.

Original issue reported on code.google.com by round.bu...@gmail.com on 11 Feb 2010 at 11:33

GoogleCodeExporter commented 9 years ago
Thank you this is exactly what i was just looking for.

Original comment by chris.a....@gmail.com on 11 Feb 2010 at 12:42