mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 690973 - Opening a new tab in portrait does not open the awesomescreen [r=wesj]
This commit is contained in:
parent
ac70357349
commit
f40512756b
@ -41,6 +41,9 @@ var TabsPopup = {
|
||||
Elements.tabs.addEventListener("TabRemove", this, true);
|
||||
|
||||
this._updateTabsCount();
|
||||
|
||||
// Bind resizeHandler so we can pass it to addEventListener/removeEventListener.
|
||||
this.resizeHandler = this.resizeHandler.bind(this);
|
||||
},
|
||||
|
||||
get box() {
|
||||
@ -117,12 +120,7 @@ var TabsPopup = {
|
||||
this.box.anchorTo(this.button, "after_end");
|
||||
BrowserUI.pushPopup(this, [this.box, this.button]);
|
||||
|
||||
window.addEventListener("resize", function resizeHandler(aEvent) {
|
||||
if (aEvent.target != window)
|
||||
return;
|
||||
if (!Util.isPortrait())
|
||||
TabsPopup._hidePortraitMenu();
|
||||
}, false);
|
||||
window.addEventListener("resize", this.resizeHandler, false);
|
||||
},
|
||||
|
||||
toggle: function toggle() {
|
||||
@ -140,7 +138,7 @@ var TabsPopup = {
|
||||
if (!this.box.hidden) {
|
||||
this.box.hidden = true;
|
||||
BrowserUI.popPopup(this);
|
||||
window.removeEventListener("resize", resizeHandler, false);
|
||||
window.removeEventListener("resize", this.resizeHandler, false);
|
||||
}
|
||||
},
|
||||
|
||||
@ -172,6 +170,13 @@ var TabsPopup = {
|
||||
cmd.setAttribute("label", Browser.tabs.length);
|
||||
},
|
||||
|
||||
resizeHandler: function resizeHandler(aEvent) {
|
||||
if (aEvent.target != window)
|
||||
return;
|
||||
if (!Util.isPortrait())
|
||||
this._hidePortraitMenu();
|
||||
},
|
||||
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
this._updateTabsCount();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user