Q:

Toggle Toolbar in Firefox extension

I have a toolbarbutton and I want it to toggle a toolbox > toolbar when it is clicked. I thought there might be an internal function similar to toggleSidebar(id) but I cannot find it.

A:

Well there is no function, however there is a simple solution for anyone looking for it.
First on the toolbarbutton add the following attribute:
oncommand="extName.toggleToolbar(event);"
then in the javascript:
toggleToolbar: function(e) {
    var toolbar = document.getElementById('uniqueName-toolbar');

    if(toolbar.getAttribute('hidden')== 'true'){
        toolbar.setAttribute('hidden', false);
    }
    else{
        toolbar.setAttribute('hidden', true);
    }
}

