Skip to content

Commit

Permalink
Don't reopen panel after mousedown anywhere inside window
Browse files Browse the repository at this point in the history
(#18)
  • Loading branch information
Infocatcher committed Dec 15, 2014
1 parent a5c5fde commit 300c80c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion downloadsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ var downloadsPanel = {
case "mouseover": this.panelMouseOver(e); break;
case "click": this.panelClick(e); break;
case "keypress": this.panelKeyPress(e); break;
case "popuphidden": this.panelHidden(e);
case "popuphidden": this.panelHidden(e); break;
case "mousedown": this.windowMouseDown(e);
}
},

Expand Down Expand Up @@ -285,6 +286,7 @@ var downloadsPanel = {
DownloadsPanel.showPanel();
}.bind(this), 10);
}.bind(this), prefs.get("reopenPanel.delay"));
window.addEventListener("mousedown", this, true);
},
cancelReopenPanel: function(window) {
var DownloadsPanel = window.DownloadsPanel;
Expand All @@ -293,8 +295,13 @@ var downloadsPanel = {
delete DownloadsPanel._dptReopenPanelTimer;
window.clearTimeout(timer);
window.clearInterval(timer);
window.removeEventListener("mousedown", this, true);
}
},
windowMouseDown: function(e) {
_log(e.type + " -> cancelReopenPanel()");
this.cancelReopenPanel(e.currentTarget);
},

panelCloseTime: 0,
panelHidden: function(e) {
Expand Down

0 comments on commit 300c80c

Please sign in to comment.