mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-25 16:13:17 +03:00
Fixes on the general settings page
This commit is contained in:
parent
0f44d37ef3
commit
2342e0d3d0
2 changed files with 3 additions and 35 deletions
|
@ -135,8 +135,6 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -144,7 +142,6 @@
|
|||
|
||||
<?php section('scripts') ?>
|
||||
|
||||
<script src="<?= asset_url('assets/js/utils/validation.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/js/utils/url.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/js/http/general_settings_http_client.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/js/pages/general_settings.js') ?>"></script>
|
||||
|
|
|
@ -6,45 +6,17 @@
|
|||
* @copyright Copyright (c) Alex Tselegidis
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* @since v1.5.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Account
|
||||
* General Settings
|
||||
*
|
||||
* Contains the functionality of the general settings page.
|
||||
*/
|
||||
App.Pages.GeneralSettings = (function () {
|
||||
const $saveSettings = $('#save-settings');
|
||||
|
||||
/**
|
||||
* Bind the backend/settings default event handlers.
|
||||
*
|
||||
* This method depends on the backend/settings html, so do not use this method on a different page.
|
||||
*/
|
||||
function bindEventHandlers() {
|
||||
/**
|
||||
* Event: Save Settings Button "Click"
|
||||
*
|
||||
* Store the setting changes into the database.
|
||||
*/
|
||||
$('.save-settings').on('click', function () {
|
||||
var data = settings.get();
|
||||
settings.save(data);
|
||||
});
|
||||
|
||||
/**
|
||||
* Event: require phone number switch "Click"
|
||||
*
|
||||
* make sure that our phone number is visible when it is required.
|
||||
*/
|
||||
$('#require-phone-number').on('click', function () {
|
||||
if ($(this).prop('checked')) {
|
||||
setShowToggleValue($('#show-phone-number'), true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the form has invalid values.
|
||||
*
|
||||
|
@ -80,8 +52,7 @@ App.Pages.GeneralSettings = (function () {
|
|||
|
||||
function serialize(generalSettings) {
|
||||
generalSettings.forEach(function (generalSetting) {
|
||||
$('input[data-field="' + generalSetting.name + '"]').val(generalSetting.value);
|
||||
$('select[data-field="' + generalSetting.name + '"]').val(generalSetting.value);
|
||||
$('[data-field="' + generalSetting.name + '"]').val(generalSetting.value);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue