Navigation Menu

Skip to content

Commit

Permalink
Blur on click outside
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Jan 1, 2020
1 parent 565178f commit 808c6c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/$Window.js
Expand Up @@ -27,6 +27,11 @@ function $Window(options){
$w.triggerHandler("focus");
}
});
$G.on("pointerdown", (e)=> {
if (e.target.closest(".window") !== $w[0]) {
$w.triggerHandler("blur");
}
});
$w.on("focus", function(e){
if ($w.is(e.target)) {
$(".window.focused").triggerHandler("blur");
Expand Down

0 comments on commit 808c6c7

Please sign in to comment.