src/index.js
// Function to select organizer profile -- updates from organizers data object
Function to select organizer profile -- updates from organizers data object
Function to select organizer profile -- updates from organizers data object
function selectProfile(e) {
	const currentProfileId = e.currentTarget.id;
	const selectedOrganizer = organizers[currentProfileId];
	if (selectedOrganizer) {
		currentProfile.classList.remove('profile--selected');
		currentProfile = document.getElementById(`${currentProfileId}`);
		currentProfile.classList.add('profile--selected');
		orgName.textContent = selectedOrganizer.name;
		orgAbout.textContent = selectedOrganizer.about;
		orgPhoto.src = selectedOrganizer.profilePhoto;
		orgPhoto.alt = `Kalispell Software Crafters organizer ${selectedOrganizer.name}`;
	}
}
function selectProfile ( e ) { const currentProfileId = e . currentTarget . id ; const selectedOrganizer = organizers [ currentProfileId ] ; if ( selectedOrganizer ) { currentProfile . classList . remove ( 'profile--selected' ) ; currentProfile = document . getElementById ( ` ${ currentProfileId } ` ) ; currentProfile . classList . add ( 'profile--selected' ) ; orgName . textContent = selectedOrganizer . name ; orgAbout . textContent = selectedOrganizer . about ; orgPhoto . src = selectedOrganizer . profilePhoto ; orgPhoto . alt = ` ${ selectedOrganizer . name } ` ; } }
Function to select organizer profile -- updates from organizers data object
Function to select organizer profile -- updates from organizers data object
// Remove default highlighted profile // Update current profile to be highlighted // Update about section content