fix profile editing bugs
This commit is contained in:
parent
2a0aeaa849
commit
bacb13ae7c
@ -76,7 +76,8 @@ Template.profile.helpers({
|
||||
return Session.get("user").name;
|
||||
},
|
||||
motd() { // Returns the current user's description
|
||||
if (Session.get("user").description !== undefined) return Session.get("user").description;
|
||||
console.log(Session.get("user").description);
|
||||
if (Session.get("user").description !== "") return Session.get("user").description;
|
||||
return "Say something about yourself!";
|
||||
},
|
||||
school() { // Returns the current user's school's name
|
||||
@ -457,8 +458,8 @@ Template.profile.events({
|
||||
try {
|
||||
for (var i = 0; i < document.getElementsByClassName("profOptions").length; i++) {
|
||||
var curr = document.getElementsByClassName("profOptions")[i];
|
||||
if (curr.childNodes[1] !== op.nextSibling.nextSibling.childNodes[1]
|
||||
&& curr.childNodes[1] !== op.parentNode.parentNode.childNodes[3].childNodes[1]) {
|
||||
if (curr.childNodes[1] !== op.nextSibling.nextSibling.childNodes[1] &&
|
||||
curr.childNodes[1] !== op.parentNode.parentNode.childNodes[3].childNodes[1]) {
|
||||
closeDivFade(document.getElementsByClassName("profOptions")[i]);
|
||||
}
|
||||
}
|
||||
@ -615,7 +616,7 @@ function getProfileData() { // Gets all data related to profile.
|
||||
|
||||
var gradein = document.getElementById("grade").childNodes[0].nodeValue;
|
||||
profile.grade = parseInt(gradein.substring(gradein.length - 2, gradein));
|
||||
if(profile.grade.includes("Click here to edit...")) profile.grade = "";
|
||||
if(!profile.grade) profile.grade = "";
|
||||
|
||||
profile.avatar = document.getElementById("profAvatar").src;
|
||||
profile.banner = document.getElementById("profBanner").src;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user