Make the backend footer sticky and remove the "placeFooterToBottom" function

This commit is contained in:
Alex Tselegidis 2023-01-14 09:40:18 +01:00
parent b62e458258
commit 4446f26399
14 changed files with 12 additions and 58 deletions

View file

@ -5,7 +5,7 @@
* @var string $user_display_name * @var string $user_display_name
*/ */
?> ?>
<div id="footer" class="d-lg-flex justify-content-lg-start align-items-lg-center p-2 text-center text-lg-left"> <div id="footer" class="d-lg-flex justify-content-lg-start align-items-lg-center p-2 text-center text-lg-left mt-auto">
<div class="mb-3 me-lg-5 mb-lg-0"> <div class="mb-3 me-lg-5 mb-lg-0">
<img class="me-1" src="<?= base_url('assets/img/logo-16x16.png') ?>" alt="Easy!Appointments Logo"> <img class="me-1" src="<?= base_url('assets/img/logo-16x16.png') ?>" alt="Easy!Appointments Logo">

View file

@ -24,12 +24,16 @@
<?php slot('styles') ?> <?php slot('styles') ?>
</head> </head>
<body> <body class="d-flex flex-column h-100">
<main class="flex-shrink-0">
<?php component('backend_header', ['active_menu' => vars('active_menu')]) ?> <?php component('backend_header', ['active_menu' => vars('active_menu')]) ?>
<?php slot('content') ?> <?php slot('content') ?>
</main>
<?php component('backend_footer', ['user_display_name' => vars('user_display_name')]) ?> <?php component('backend_footer', ['user_display_name' => vars('user_display_name')]) ?>
<script src="<?= asset_url('assets/vendor/jquery/jquery.min.js') ?>"></script> <script src="<?= asset_url('assets/vendor/jquery/jquery.min.js') ?>"></script>

View file

@ -9,6 +9,10 @@
* @since v1.5.0 * @since v1.5.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
html {
height: 100%;
}
@-moz-document url-prefix() { @-moz-document url-prefix() {
body .checkbox input[type='checkbox'] { body .checkbox input[type='checkbox'] {
float: left; float: left;

View file

@ -37,20 +37,6 @@ window.App.Layouts.Backend = (function () {
const PRIV_SYSTEM_SETTINGS = 'system_settings'; const PRIV_SYSTEM_SETTINGS = 'system_settings';
const PRIV_USER_SETTINGS = 'user_settings'; const PRIV_USER_SETTINGS = 'user_settings';
function placeFooterToBottom() {
if (window.innerHeight > $('body').height()) {
$footer.css({
'position': 'absolute',
'width': '100%',
'bottom': '0px'
});
} else {
$footer.css({
'position': 'static'
});
}
}
/** /**
* Display backend notifications to user. * Display backend notifications to user.
* *
@ -103,12 +89,6 @@ window.App.Layouts.Backend = (function () {
* Initialize the module. * Initialize the module.
*/ */
function initialize() { function initialize() {
$(window)
.on('resize', () => {
App.Layouts.Backend.placeFooterToBottom();
})
.trigger('resize');
$(document).ajaxStart(() => { $(document).ajaxStart(() => {
$loading.show(); $loading.show();
}); });
@ -139,7 +119,6 @@ window.App.Layouts.Backend = (function () {
PRIV_USERS, PRIV_USERS,
PRIV_SYSTEM_SETTINGS, PRIV_SYSTEM_SETTINGS,
PRIV_USER_SETTINGS, PRIV_USER_SETTINGS,
placeFooterToBottom,
displayNotification displayNotification
}; };
})(); })();

View file

@ -190,8 +190,6 @@ App.Pages.Account = (function () {
$saveSettings.on('click', onSaveSettingsClick); $saveSettings.on('click', onSaveSettingsClick);
$username.on('change', onUsernameChange); $username.on('change', onUsernameChange);
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -97,8 +97,6 @@ App.Pages.ApiSettings = (function () {
const apiSettings = vars('api_settings'); const apiSettings = vars('api_settings');
deserialize(apiSettings); deserialize(apiSettings);
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -221,8 +221,6 @@ App.Pages.BookingSettings = (function () {
deserialize(bookingSettings); deserialize(bookingSettings);
applyInitialState(); applyInitialState();
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -166,8 +166,6 @@ App.Pages.BusinessSettings = (function () {
$saveSettings.on('click', onSaveSettingsClick); $saveSettings.on('click', onSaveSettingsClick);
$applyGlobalWorkingPlan.on('click', onApplyGlobalWorkingPlan); $applyGlobalWorkingPlan.on('click', onApplyGlobalWorkingPlan);
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -172,8 +172,6 @@ App.Pages.GeneralSettings = (function () {
const generalSettings = vars('general_settings'); const generalSettings = vars('general_settings');
deserialize(generalSettings); deserialize(generalSettings);
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -97,8 +97,6 @@ App.Pages.GoogleAnalyticsSettings = (function () {
const googleAnalyticsSettings = vars('google_analytics_settings'); const googleAnalyticsSettings = vars('google_analytics_settings');
deserialize(googleAnalyticsSettings); deserialize(googleAnalyticsSettings);
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -150,8 +150,6 @@ App.Pages.LegalSettings = (function () {
deserialize(legalSettings); deserialize(legalSettings);
$saveSettings.on('click', onSaveSettingsClick); $saveSettings.on('click', onSaveSettingsClick);
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -97,8 +97,6 @@ App.Pages.MatomoAnalyticsSettings = (function () {
const matomoAnalyticsSettings = vars('matomo_analytics_settings'); const matomoAnalyticsSettings = vars('matomo_analytics_settings');
deserialize(matomoAnalyticsSettings); deserialize(matomoAnalyticsSettings);
App.Layouts.Backend.placeFooterToBottom();
} }
document.addEventListener('DOMContentLoaded', initialize); document.addEventListener('DOMContentLoaded', initialize);

View file

@ -215,13 +215,6 @@ App.Pages.Providers = (function () {
} }
}); });
/**
* Event: Display Provider Details "Click"
*/
$providers.on('shown.bs.tab', 'a[data-bs-toggle="tab"]', () => {
App.Layouts.Backend.placeFooterToBottom();
});
/** /**
* Event: Reset Working Plan Button "Click". * Event: Reset Working Plan Button "Click".
*/ */
@ -461,7 +454,6 @@ App.Pages.Providers = (function () {
.find('.edit-working-plan-exception, .delete-working-plan-exception') .find('.edit-working-plan-exception, .delete-working-plan-exception')
.prop('disabled', true); .prop('disabled', true);
$providers.find('.working-plan input:checkbox').prop('disabled', true); $providers.find('.working-plan input:checkbox').prop('disabled', true);
App.Layouts.Backend.placeFooterToBottom();
} }
/** /**

View file

@ -127,9 +127,6 @@ App.Utils.CalendarTableView = (function () {
currentDate = moment(currentDate).add({days: 1}).toDate(); currentDate = moment(currentDate).add({days: 1}).toDate();
} }
// setCalendarViewSize();
App.Layouts.Backend.placeFooterToBottom();
}); });
}); });
@ -536,8 +533,6 @@ App.Utils.CalendarTableView = (function () {
$('#calendar .calendar-view').remove(); $('#calendar .calendar-view').remove();
App.Layouts.Backend.placeFooterToBottom();
const $calendarView = $('<div/>', { const $calendarView = $('<div/>', {
'class': 'calendar-view' 'class': 'calendar-view'
}).appendTo('#calendar'); }).appendTo('#calendar');
@ -559,8 +554,6 @@ App.Utils.CalendarTableView = (function () {
setCalendarViewSize(); setCalendarViewSize();
App.Layouts.Backend.placeFooterToBottom();
// Activate calendar navigation. // Activate calendar navigation.
$('#calendar .calendar-header .btn').removeClass('disabled').prop('disabled', false); $('#calendar .calendar-header .btn').removeClass('disabled').prop('disabled', false);
@ -676,8 +669,6 @@ App.Utils.CalendarTableView = (function () {
// Add the unavailabilities to the column. // Add the unavailabilities to the column.
/** @var {Array} events.unavailabilities */ /** @var {Array} events.unavailabilities */
createUnavailabilities($providerColumn, events.unavailabilities); createUnavailabilities($providerColumn, events.unavailabilities);
App.Layouts.Backend.placeFooterToBottom();
} }
/** /**