Skip to content

Commit

Permalink
Update venue-info-component-controller.js
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai committed Aug 16, 2024
1 parent f4284ed commit 03ff489
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ECC_ENV } from '../../../scripts/scripts.js';
import { changeInputValue, getSecret } from '../../../scripts/utils.js';
import { buildErrorMessage } from '../form-handler.js';

function togglePrefillableFields(component, showPrefilledFields) {
function togglePrefillableFieldsHiddenState(component, showPrefilledFields) {
const addressInput = component.querySelector('#venue-info-venue-address');
const cityInput = component.querySelector('#location-city');
const stateInput = component.querySelector('#location-state');
Expand Down Expand Up @@ -96,7 +96,7 @@ function initAutocomplete(el) {
changeInputValue(placeId, 'value', place.place_id);
changeInputValue(mapUrl, 'value', place.url);

togglePrefillableFields(el, true);
togglePrefillableFieldsHiddenState(el, false);
}

if (place.geometry) {
Expand Down Expand Up @@ -135,7 +135,7 @@ export default async function init(component, props) {
const mapUrlInput = component.querySelector('#google-map-url');
const gmtoffsetInput = component.querySelector('#google-place-gmt-offset');

togglePrefillableFields(component, false);
togglePrefillableFieldsHiddenState(component, true);

venueNameInput.addEventListener('change', () => {
if (!venueNameInput.value) {
Expand Down Expand Up @@ -181,7 +181,7 @@ export default async function init(component, props) {

if (venueName) {
component.classList.add('prefilled');
togglePrefillableFields(component, true);
togglePrefillableFieldsHiddenState(component, false);
}
}

Expand Down

0 comments on commit 03ff489

Please sign in to comment.