Skip to content

Instantly share code, notes, and snippets.

@bastimeyer
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastimeyer/5cdc1973c0d3a39aad98 to your computer and use it in GitHub Desktop.
Save bastimeyer/5cdc1973c0d3a39aad98 to your computer and use it in GitHub Desktop.
Node-Webkit v0.10.0 bug / -webkit-app-region: drag
notice the mouseout event: this will only fire when the cursor is leaving the drag region
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>foo</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<div style="padding: 5em; background: rgba(0,0,0,.25); -webkit-app-region: drag">
<button type="button" class="btn btn-primary" style="-webkit-app-region: no-drag" onclick="window.close()">close window</button>
</div>
<script>
document.querySelector( "button" ).addEventListener( "mouseover", function() { console.log( "mouseover" ); }, false );
document.querySelector( "button" ).addEventListener( "mouseout", function() { console.log( "mouseout" ); }, false );
</script>
</body>
</html>
{
"name": "foo",
"version": "0.0.1",
"main": "index.html",
"window": {
"title": "foo",
"frame": false,
"resizable": true,
"toolbar": false,
"show": true,
"position": "center",
"width": 960,
"height": 540
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment