2011-01-08 07:03:27 -08:00
|
|
|
var AppMenu = {
|
|
|
|
get panel() {
|
|
|
|
delete this.panel;
|
|
|
|
return this.panel = document.getElementById("appmenu");
|
|
|
|
},
|
|
|
|
|
|
|
|
show: function show() {
|
|
|
|
if (BrowserUI.activePanel || BrowserUI.isPanelVisible())
|
|
|
|
return;
|
|
|
|
this.panel.setAttribute("count", this.panel.childNodes.length);
|
2011-02-15 10:26:51 -08:00
|
|
|
this.panel.hidden = false;
|
2011-01-08 07:03:27 -08:00
|
|
|
|
|
|
|
addEventListener("keypress", this, true);
|
|
|
|
|
|
|
|
BrowserUI.lockToolbar();
|
|
|
|
BrowserUI.pushPopup(this, [this.panel, Elements.toolbarContainer]);
|
|
|
|
},
|
|
|
|
|
|
|
|
hide: function hide() {
|
2011-02-15 10:26:51 -08:00
|
|
|
this.panel.hidden = true;
|
2011-01-08 07:03:27 -08:00
|
|
|
|
|
|
|
removeEventListener("keypress", this, true);
|
|
|
|
|
|
|
|
BrowserUI.unlockToolbar();
|
|
|
|
BrowserUI.popPopup(this);
|
|
|
|
},
|
|
|
|
|
|
|
|
toggle: function toggle() {
|
2011-02-15 10:26:51 -08:00
|
|
|
this.panel.hidden ? this.show() : this.hide();
|
2011-01-08 07:03:27 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
handleEvent: function handleEvent(aEvent) {
|
|
|
|
this.hide();
|
|
|
|
}
|
|
|
|
};
|