diff --git a/src/static/dashboard.html b/src/static/dashboard.html
index c345ac4..351fce4 100644
--- a/src/static/dashboard.html
+++ b/src/static/dashboard.html
@@ -764,7 +764,7 @@
-
+
diff --git a/src/static/js/tutorial.js b/src/static/js/tutorial.js
index 43e38e8..b650705 100644
--- a/src/static/js/tutorial.js
+++ b/src/static/js/tutorial.js
@@ -11,6 +11,7 @@ const Tutorial = {
_keyHandler: null,
_resizeHandler: null,
_demoRunning: false,
+ _stepTimers: [], // setTimeout-IDs fuer den aktuellen Step
_savedState: null, // Dashboard-Zustand vor dem Tutorial
// DOM-Referenzen
@@ -397,6 +398,18 @@ const Tutorial = {
_cleanupFns: [],
+ // Timer-Helfer: Timeouts die beim Step-Wechsel automatisch gecancelt werden
+ _stepTimeout(fn, ms) {
+ var id = setTimeout(fn, ms);
+ this._stepTimers.push(id);
+ return id;
+ },
+
+ _clearStepTimers() {
+ this._stepTimers.forEach(function(id) { clearTimeout(id); });
+ this._stepTimers = [];
+ },
+
// -----------------------------------------------------------------------
// Scroll-Helfer: Element in den sichtbaren Bereich scrollen
// -----------------------------------------------------------------------
@@ -450,7 +463,7 @@ const Tutorial = {
text: 'Hier starten Sie die Erstellung einer neuen Lage. Im nächsten Schritt zeigen wir Ihnen das Formular dazu.',
position: 'right',
onEnter: function() {
- setTimeout(function() {
+ Tutorial._stepTimeout(function() {
var overlay = document.getElementById('modal-new');
if (overlay && !overlay.classList.contains('active')) {
overlay.classList.add('active');
@@ -813,7 +826,7 @@ const Tutorial = {
+ 'Quellen deaktivieren - Temporär oder dauerhaft ausschließen',
position: 'right',
onEnter: function() {
- setTimeout(function() {
+ Tutorial._stepTimeout(function() {
var overlay = document.getElementById('modal-sources');
if (overlay && !overlay.classList.contains('active')) {
if (typeof App !== 'undefined' && App.openSourceManagement) {
@@ -822,6 +835,13 @@ const Tutorial = {
}
}, 1500);
},
+ onExit: function() {
+ var overlay = document.getElementById('modal-sources');
+ if (overlay) {
+ overlay.classList.remove('active');
+ overlay.style.zIndex = '';
+ }
+ },
},
// 22 - Quellen Modal
{
@@ -923,10 +943,30 @@ const Tutorial = {
this._hideCursor();
this._clearSubHighlights();
+ // Step-Timers canceln
+ this._clearStepTimers();
+
+ // Alle Modals schliessen die das Tutorial geoeffnet haben koennte
+ ['modal-new', 'modal-sources'].forEach(function(id) {
+ var overlay = document.getElementById(id);
+ if (overlay) {
+ overlay.classList.remove('active');
+ overlay.style.zIndex = '';
+ }
+ });
+
// Cleanup-Callbacks
this._cleanupFns.forEach(function(fn) { try { fn(); } catch(e) {} });
this._cleanupFns = [];
+ // Formular-Inputs zuruecksetzen
+ var titleInput = document.getElementById('inc-title');
+ if (titleInput) titleInput.value = '';
+ var descInput = document.getElementById('inc-description');
+ if (descInput) descInput.value = '';
+ var selType = document.getElementById('inc-type');
+ if (selType) { selType.value = 'adhoc'; try { selType.dispatchEvent(new Event('change')); } catch(e) {} }
+
// Demo-View entfernen
this._removeDemoView();
@@ -996,6 +1036,7 @@ const Tutorial = {
_exitStep(i) {
var step = this._steps[i];
+ this._clearStepTimers();
if (step.onExit) {
step.onExit();
}