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, "maximize": false,
"hidden": false, "hidden": false,
"resizable": true, "resizable": true,
"exitProcessOnClose": true "exitProcessOnClose": false
}, },
"browser": { "browser": {
"globalVariables": { "globalVariables": {

View File

@ -3,6 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Cooperate Cleaner</title> <title>Cooperate Cleaner</title>
<script src="js/neutralino.js"></script>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="lib/bootstrap.min.css"> <link rel="stylesheet" href="lib/bootstrap.min.css">
<link rel="stylesheet" href="lib/animate.min.css"> <link rel="stylesheet" href="lib/animate.min.css">
@ -19,6 +20,5 @@
because `neu update` typically downloads it. because `neu update` typically downloads it.
Avoid copy-pasting it. Avoid copy-pasting it.
--> -->
<script src="js/neutralino.js"></script>
</body> </body>
</html> </html>

View File

@ -1,4 +1,5 @@
$(document).ready(function() { Neutralino.init();
$(document).ready(async function() {
// Load navbar // Load navbar
$('#navbar').load('components/navbar.html', function() { $('#navbar').load('components/navbar.html', function() {
// Attach click event to navbar links // Attach click event to navbar links
@ -15,6 +16,12 @@ $(document).ready(function() {
// Load the initial view // Load the initial view
const initialView = location.hash.replace('#', '') || 'home'; const initialView = location.hash.replace('#', '') || 'home';
loadView(initialView); loadView(initialView);
// Enable window close event
await Neutralino.events.on('windowClose', () => {
Neutralino.app.exit();
});
}); });
function loadView(view) { function loadView(view) {
@ -44,3 +51,5 @@ function loadView(view) {
}); });
} }