Fixed close bug 2

This commit is contained in:
Max W. 2024-05-20 01:04:48 +02:00
parent 3b5092410a
commit d801e39c44
3 changed files with 12 additions and 3 deletions

View File

@ -46,7 +46,7 @@
"maximize": false,
"hidden": false,
"resizable": true,
"exitProcessOnClose": true
"exitProcessOnClose": false
},
"browser": {
"globalVariables": {

View File

@ -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>

View File

@ -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) {
});
}