Fixed minor bugs

This commit is contained in:
Kenneth Jao 2016-08-28 23:25:43 -04:00
parent 79dd0c2c0e
commit 81ebc744d8
3 changed files with 70 additions and 68 deletions

View File

@ -123,7 +123,7 @@
</div> </div>
<div> <div>
<span class="workTitle">Description:</span><br> <span class="workTitle">Description:</span><br>
<span class="change req" type="textarea" id="workDesc">{{work 'description'}}</span> <span class="change" type="textarea" id="workDesc">{{work 'description'}}</span>
</div> </div>
<div> <div>
<div class="inputRadio"> <div class="inputRadio">
@ -163,6 +163,7 @@
{{/unless}} {{/unless}}
</div> </div>
</div> </div>
{{#unless newWork}}
<div id="workToggle"> <div id="workToggle">
<div id="done"> <div id="done">
{{#each work 'done'}} {{#each work 'done'}}
@ -184,6 +185,7 @@
</div> </div>
</div> </div>
</div> </div>
{{/unless}}
{{#if newWork}} {{#if newWork}}
{{#if inRole}} {{#if inRole}}
<div id="workSubmit">Save</div> <div id="workSubmit">Save</div>

View File

@ -65,7 +65,7 @@ var ref = {
}; };
// Reactive variables. // Reactive variables.
Session.set("calendarclasses", null); Session.set("calendarclasses", null); //
Session.set("sidebar", null); Session.set("sidebar", null);
Session.set("newWork",null); Session.set("newWork",null);
Session.set("currentWork",null); Session.set("currentWork",null);
@ -79,16 +79,16 @@ Session.set("classDisp",[]);
Session.set("classDispHover",null); Session.set("classDispHover",null);
Session.set("commentRestrict",null); Session.set("commentRestrict",null);
Template.registerHelper('divColor', (div) => { Template.registerHelper('divColor', (div) => { // Reactive color changing based on preferences. Colors stored in Session.get("themeColors").
return Session.get("themeColors")[Meteor.user().profile.preferences.theme][div]; return Session.get("themeColors")[Meteor.user().profile.preferences.theme][div];
}); });
Template.registerHelper('textColor', () => { Template.registerHelper('textColor', () => { // Reactive color for text.
document.getElementsByTagName("body")[0].style.color = Session.get("themeColors")[Meteor.user().profile.preferences.theme].text; document.getElementsByTagName("body")[0].style.color = Session.get("themeColors")[Meteor.user().profile.preferences.theme].text;
return; return;
}); });
Template.registerHelper('overlayDim', (part) => { Template.registerHelper('overlayDim', (part) => { // Gets size of the overlay container.
var dim = [window.innerWidth * 0.25, window.innerHeight * 0.2]; var dim = [window.innerWidth * 0.25, window.innerHeight * 0.2];
var width = "width:" + dim[0].toString() + "px;"; var width = "width:" + dim[0].toString() + "px;";
var height = "height:" + dim[1].toString() + "px;"; var height = "height:" + dim[1].toString() + "px;";
@ -505,6 +505,9 @@ Template.main.events({
document.getElementById("workComment").value = ""; document.getElementById("workComment").value = "";
} }
Session.set("newWork",null); Session.set("newWork",null);
Session.set("currentWork",null);
Session.set("currentReadableWork",null);
$('.req').css("color","")
Session.set("commentRestrict",null); Session.set("commentRestrict",null);
} }
@ -890,12 +893,6 @@ function getHomeworkFormData() {
stop = true; stop = true;
} }
} }
var desc = document.getElementById("workDesc");
if(desc.childNodes[0].nodeValue.includes("Click here to edit")) {
desc.childNodes[0].nodeValue = "Missing field";
desc.style.color = "#FF1A1A";
stop = true;
}
if(stop) return null; if(stop) return null;
var data = Session.get("currentWork"); var data = Session.get("currentWork");
@ -940,6 +937,7 @@ function formReadable(input) {
input.dueDate = getReadableDate(input.dueDate); input.dueDate = getReadableDate(input.dueDate);
input.type = input.type[0].toUpperCase() + input.type.slice(1); input.type = input.type[0].toUpperCase() + input.type.slice(1);
if(!Session.get("newWork")) {
if(input.done.indexOf(Meteor.userId()) !== -1) { if(input.done.indexOf(Meteor.userId()) !== -1) {
input.doneCol = "#27A127"; input.doneCol = "#27A127";
input.doneText = "Done!"; input.doneText = "Done!";
@ -978,5 +976,6 @@ function formReadable(input) {
} }
input.comments = resort; input.comments = resort;
} }
}
return input; return input;
} }

View File

@ -264,6 +264,7 @@
margin-bottom: 3%; margin-bottom: 3%;
padding: 2%; padding: 2%;
background-color: #19B3B3;
box-shadow: 2px 2px 5px 3px #666; box-shadow: 2px 2px 5px 3px #666;
display: table; display: table;
cursor: pointer; cursor: pointer;
@ -275,7 +276,7 @@
} }
.classBox:hover { .classBox:hover {
background-color: rgba(0,0,0,0.1); background-color: #138686;
} }
#private { #private {