Skip to content

Commit

Permalink
Resolved Issues
Browse files Browse the repository at this point in the history
Reformatted if-else, try-catch statements to be more visible
  • Loading branch information
sampoearas authored Jul 25, 2019
1 parent b2bd31a commit 20d949b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Innovator/Client/scripts/kanban/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,18 @@ function loadBoards() {
var vaultref = item.getProperty("creatorpicture","undefined");
var fileUrl = "../kanban/nomanager.png";
if ((vaultref !== "undefined") && (vaultRefTable[vaultref] == undefined)) {
try{fileUrl = inn.getFileUrl(vaultref.split("?fileId=")[1], 1);
try {
fileUrl = inn.getFileUrl(vaultref.split("?fileId=")[1], 1);
vaultRefTable[vaultref] = fileUrl;
}
catch(err){
console.log("Profile Image for " + item.getPropertyAttribute("created_by_id", "keyed_name") + " is malformed. Please choose a different image.");
}

}
else{vaultRefTable[vaultref] = fileUrl;}
else {
vaultRefTable[vaultref] = fileUrl;
}

boardsContentString += "<div class='col-md-3 board' boardId='" + item.getID() + "'><div class='panel panel-default'> <div class='panel-heading boardHeader'> <h3 class='panel-title boardTitle' contentEditable='true'>" + item.getProperty('boardname', 'no name') + "</h3> </div> <div class='panel-body boardDescription' contentEditable='true'>" + item.getProperty('boarddescription', 'no description') + " </div>";
boardsContentString += " <div class='panel-footer '><div title='<h5>" + item.getPropertyAttribute("created_by_id", "keyed_name") + "</h5><img class=\"managerPicture\" width=\"96px\" src=\"" + vaultRefTable[vaultref] + " \" />' data-placement='top' data-html='true' rel='tooltip' class='userInitiales'>" + nameInitiliser(item.getPropertyAttribute("created_by_id", "keyed_name")) + "</div> <img src='" + vaultRefTable[vaultref] + "' alt='no manager' class='img-circle userInitiales' ></div>";
Expand Down Expand Up @@ -461,15 +464,18 @@ function loadSingleBoard(boardId, reload) {
var vaultref = item.getProperty("managerpicture");
var fileUrl = "../kanban/nomanager.png";
if ((vaultref !== undefined) && (vaultRefTable[vaultref] == undefined)) {
try{fileUrl = inn.getFileUrl(vaultref.split("?fileId=")[1], 1);
try{
fileUrl = inn.getFileUrl(vaultref.split("?fileId=")[1], 1);
vaultRefTable[vaultref] = fileUrl;
}
catch(err){
console.log("Profile Image for " + item.getPropertyAttribute("manager", "keyed_name") + " is malformed. Please choose a different image.");
}

}
else {vaultRefTable[vaultref] = fileUrl;}
else {
vaultRefTable[vaultref] = fileUrl;
}



Expand Down

0 comments on commit 20d949b

Please sign in to comment.