When you navigate to a different tab and open the popup, tag suggestions
from the previous instance of the popup are also displayed. The default CSS
class hides the tag suggestions element but when some tag suggestions are
displayed, the hidden class is removed.

When you close the popup and re-open it later in some other tab, the CSS
class is not applied by default and hence the extra care.
On Apr 29, 2014 2:05 AM, "Matt McKeon" <notifications@github.com> wrote:

> In src/data/popup.js:
>
> >      var suggested = document.getElementById("suggested_tags");
> >      var latest = document.getElementById("latest_tags");
> > +
> > +    // When you navigate to a different tab, make sure to delete
> > +    // the tag suggestions for the tab where the panel was
> > +    // previously used. Hide the element and defer the unhide
> > +    // until the tagList object has some tags in it.
> > +    isHidden = suggested.className.indexOf('hidden') !== -1;
> > +    if (!isHidden) {
> > +        suggested.className = suggested.className + " hidden";
> > +        isHidden = true;
> > +    }
> > +
>
> I'm still not totally clear why we have to do this extra hide step, since
> that is the default CSS class in popup.html. But, this seems to work well
> enough for v1.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/bookieio/bookie-firefox/pull/20/files#r12066211>
> .
>