Files
BeWoPlaner/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/scheduler.js

61 lines
1.4 KiB
JavaScript
Raw Normal View History

2025-01-17 16:21:58 +01:00
function submitInsertAppointmentForm() {
showSpinner();
2025-01-17 16:21:58 +01:00
window.validateAppointmentForm();
}
function submitSchedulerDateForm() {
showSpinner();
$("#scheduler-date-form").submit();
}
function hideAppointmentForm() {
$("#form-container").addClass("d-none d-sm-none");
}
function showAppointmentForm() {
$("#form-container").removeClass("d-none d-sm-none");
2025-01-17 16:21:58 +01:00
window.calcPrependTextSizes();
}
function toggleAppointmentForm() {
2025-01-17 16:21:58 +01:00
const isVisible = $("#form-container").css("display") === "block";
2025-01-17 16:21:58 +01:00
if(isVisible) {
hideAppointmentForm();
} else {
showAppointmentForm();
}
}
function listSearchOnChange(searchInputId, entryClass, textClass) {
try {
2025-01-17 16:21:58 +01:00
var text = $(`#${searchInputId}`).val().toLowerCase();
2025-01-17 16:21:58 +01:00
const entries = $(`.${entryClass}`);
2025-01-17 16:21:58 +01:00
if(text.length === 0) {
entries.show();
}
2025-01-17 16:21:58 +01:00
$.each(entries, function(index, item) {
const customer = $(item);
2025-01-17 16:21:58 +01:00
if(customer.find(`.${textClass}`).text().toLowerCase().includes(text)) {
customer.show();
} else {
customer.hide();
}
});
2025-01-17 16:21:58 +01:00
} catch(error) {
window.showErrorPopup(error);
}
}
function resetSearch(searchInputId, entryClass) {
try {
2025-01-17 16:21:58 +01:00
$(`#${searchInputId}`).val("");
$(`.${entryClass}`).show();
} catch (error) {
2025-01-17 16:21:58 +01:00
window.showErrorPopup(error);
}
}