Skip to content

Commit

Permalink
deletion in view fix (else added);
Browse files Browse the repository at this point in the history
view re-writing after deletion added
  • Loading branch information
UltimateHikari committed Nov 28, 2018
1 parent 6a8812d commit 240c75e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion module_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ function view_refreshTeamView(team, modelData, maxProblem, viewSheet){
}
/// exctraction from 2017 script FACE algo
for(i in attemptsArray){
var curRange = viewSheet.getRange(VIEW_START_X + team, VIEW_START_Y + parseInt(i));
if(attemptsArray[i][1] > 0){
var curRange = viewSheet.getRange(VIEW_START_X + team, VIEW_START_Y + parseInt(i));
value = String(attemptsArray[i][1] - attemptsArray[i][0]);
if(value == "0"){
value = "";
}
curRange.setValue(SYMBOLS[attemptsArray[i][0]] + value);
curRange.setFontColor(FONTS[attemptsArray[i][0]]);
curRange.setHorizontalAlignment("center");
}else{
curRange.setValue("");
}
}
}
4 changes: 4 additions & 0 deletions server_Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,13 @@ function deleteForm(token, link, id){
for(i in modelData){
try{
var item = JSON.parse(modelData[i][0]);
var team = item.team;
if(item.token == token){
modelData[i][0] = "";
view_refreshTeamView(team, modelData,
module_getParams(id).problem, GetSheet(VIEW, id));
modelRange.setValues(modelData);

return link;
}
} catch(err){
Expand Down

0 comments on commit 240c75e

Please sign in to comment.