-
Notifications
You must be signed in to change notification settings - Fork 0
/
Profile.js
28 lines (24 loc) · 1.04 KB
/
Profile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
document.getElementById('profile-image-input').addEventListener('change', function() {
var file = this.files[0];
var reader = new FileReader();
reader.onloadend = function() {
document.querySelector('.profile-image').src = reader.result;
};
if (file) {
reader.readAsDataURL(file);
}
});
document.addEventListener('DOMContentLoaded', () => {
const editProfileButton = document.getElementById('edit-profile-button');
const cancelEditButton = document.getElementById('cancel-edit-button');
const profileView = document.querySelectorAll('#profile-view');
const editProfileView = document.getElementById('edit-profile-view');
editProfileButton.addEventListener('click', () => {
profileView.forEach(view => view.style.display = 'none');
editProfileView.style.display = 'flex';
});
cancelEditButton.addEventListener('click', () => {
profileView.forEach(view => view.style.display = 'block');
editProfileView.style.display = 'flex';
});
});