mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 14:42:23 +03:00
The provider URL parameter will now display the provider even if teh option doesn't exist on page load (fixes #24).
This commit is contained in:
parent
f9cb6b6879
commit
84ccd956df
3 changed files with 24 additions and 10 deletions
|
@ -577,15 +577,6 @@ body .form-horizontal .controls {
|
|||
}
|
||||
|
||||
|
||||
#users-page .filter-records .results hr {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
#users-page .details {
|
||||
max-width: 800px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#users-page .working-plan td input[type="text"] {
|
||||
width: 55px;
|
||||
margin: 10px 0;
|
||||
|
@ -597,6 +588,15 @@ body .form-horizontal .controls {
|
|||
margin: 0px;
|
||||
}
|
||||
|
||||
#users-page #providers .record-details h3 a {
|
||||
font-size: 24px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#users-page #providers .record-details #provider-services .checkbox a {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/* BACKEND SETTINGS PAGE
|
||||
-------------------------------------------------------------------- */
|
||||
#settings-page h2 {
|
||||
|
|
|
@ -341,6 +341,7 @@
|
|||
|
||||
$('#providers .add-edit-delete-group').show();
|
||||
$('#providers .save-cancel-group').hide();
|
||||
$('#providers .record-details h3 a').remove();
|
||||
$('#providers .record-details').find('input, textarea').prop('readonly', true);
|
||||
$('#providers .form-message').hide();
|
||||
$('#provider-notifications').removeClass('active');
|
||||
|
|
|
@ -110,7 +110,7 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
var $selectProvider = $('#select-provider');
|
||||
var $selectService = $('#select-service');
|
||||
|
||||
// Check if a specific service was selected.
|
||||
// Check if a specific service was selected (via URL parameter).
|
||||
var selectedServiceId = GeneralFunctions.getUrlParameter(location.href, 'service');
|
||||
|
||||
if (selectedServiceId && $selectService.find('option[value="' + selectedServiceId + '"]').length > 0) {
|
||||
|
@ -125,6 +125,19 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
// Check if a specific provider was selected.
|
||||
var selectedProviderId = GeneralFunctions.getUrlParameter(location.href, 'provider');
|
||||
|
||||
if (selectedProviderId && $selectProvider.find('option[value="' + selectedProviderId + '"]').length === 0) {
|
||||
// Select a service of this provider in order to make the provider available in the select box.
|
||||
for (var index in GlobalVariables.availableProviders) {
|
||||
var provider = GlobalVariables.availableProviders[index];
|
||||
|
||||
if (provider.id === selectedProviderId && provider.services.length > 0) {
|
||||
$selectService
|
||||
.val(provider.services[0])
|
||||
.trigger('change');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedProviderId && $selectProvider.find('option[value="' + selectedProviderId + '"]').length > 0) {
|
||||
$selectProvider
|
||||
.val(selectedProviderId)
|
||||
|
|
Loading…
Reference in a new issue