You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
new admin system, ui changes, bugfixes
This commit is contained in:
62
web/js/wizard.js
Normal file
62
web/js/wizard.js
Normal file
@@ -0,0 +1,62 @@
|
||||
$(document).ready(function() {
|
||||
if($('.step:visible').index() == 0) {
|
||||
$('.btn-prev').hide();
|
||||
}
|
||||
|
||||
$('.btn-next').click(function() {
|
||||
var currentStep = $('.step:visible');
|
||||
var nextStep = currentStep.next('.step');
|
||||
|
||||
if (nextStep.length !== 0) {
|
||||
currentStep.hide();
|
||||
nextStep.show();
|
||||
updateProgressBar(nextStep);
|
||||
} else {
|
||||
submitData();
|
||||
}
|
||||
|
||||
updateWizardContent();
|
||||
});
|
||||
|
||||
$('.btn-prev').click(function() {
|
||||
var currentStep = $('.step:visible');
|
||||
var nextStep = currentStep.prev('.step');
|
||||
|
||||
if (nextStep.length !== 0) {
|
||||
currentStep.hide();
|
||||
nextStep.show();
|
||||
updateProgressBar(nextStep);
|
||||
} else {
|
||||
alert('You have reached the beginning of the wizard.');
|
||||
}
|
||||
|
||||
updateWizardContent();
|
||||
});
|
||||
});
|
||||
|
||||
// Function to update the progress bar buttons
|
||||
function updateProgressBar(currentStep) {
|
||||
var stepIndex = $('.step').index(currentStep) + 1;
|
||||
$('.btn-rounded-cube').removeClass('activated');
|
||||
$('.btn-rounded-cube:lt(' + stepIndex + ')').addClass('activated');
|
||||
}
|
||||
|
||||
function updateWizardContent() {
|
||||
if($('.step:visible').index() == 0) {
|
||||
$('.btn-prev').hide();
|
||||
} else {
|
||||
$('.btn-prev').show();
|
||||
}
|
||||
|
||||
if($('.step:visible').index() == 2) {
|
||||
setTimeout(function () {
|
||||
map.invalidateSize();
|
||||
}, 200);
|
||||
}
|
||||
|
||||
if($('.step:visible').index() == 3) {
|
||||
$('.btn-next').text('Save');
|
||||
} else {
|
||||
$('.btn-next').text('Next')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user