Fixed close bug 2
This commit is contained in:
parent
3b5092410a
commit
d801e39c44
@ -46,7 +46,7 @@
|
||||
"maximize": false,
|
||||
"hidden": false,
|
||||
"resizable": true,
|
||||
"exitProcessOnClose": true
|
||||
"exitProcessOnClose": false
|
||||
},
|
||||
"browser": {
|
||||
"globalVariables": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cooperate Cleaner</title>
|
||||
<script src="js/neutralino.js"></script>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<link rel="stylesheet" href="lib/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="lib/animate.min.css">
|
||||
@ -19,6 +20,5 @@
|
||||
because `neu update` typically downloads it.
|
||||
Avoid copy-pasting it.
|
||||
-->
|
||||
<script src="js/neutralino.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
11
src/index.js
11
src/index.js
@ -1,4 +1,5 @@
|
||||
$(document).ready(function() {
|
||||
Neutralino.init();
|
||||
$(document).ready(async function() {
|
||||
// Load navbar
|
||||
$('#navbar').load('components/navbar.html', function() {
|
||||
// Attach click event to navbar links
|
||||
@ -15,6 +16,12 @@ $(document).ready(function() {
|
||||
// Load the initial view
|
||||
const initialView = location.hash.replace('#', '') || 'home';
|
||||
loadView(initialView);
|
||||
|
||||
// Enable window close event
|
||||
await Neutralino.events.on('windowClose', () => {
|
||||
Neutralino.app.exit();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function loadView(view) {
|
||||
@ -44,3 +51,5 @@ function loadView(view) {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user