Removed defaults client side

This commit is contained in:
Kenneth Jao 2016-08-31 23:08:12 -04:00
parent 876272ada9
commit 2b96ce9d4f
4 changed files with 3 additions and 26 deletions

View File

@ -189,9 +189,10 @@
{{#if inRole}}
{{#if newWork}}
<div id="workSubmit">Save</div>
{{/if}}
{{else}}
<div id="workDelete">Delete</div>
{{/if}}
{{/if}}
</div>
</div>
</div>

View File

@ -150,15 +150,6 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
});
Template.registerHelper('pref', (val) => { // Obtains all user preferences.
if(Meteor.user().profile.preferences === undefined) return;
if(Object.keys(Meteor.user().profile.preferences).length !== Object.keys(defaults).length) { // Invalid preference checking.
var array = Meteor.user().profile;
array.preferences = defaults;
serverData = array;
sendData("editProfile");
if(val === 'timeHide' || val === 'done') return defaults[val];
return defaults[val].charAt(0).toUpperCase() + defaults[val].slice(1);
} else {
var preferences = Meteor.user().profile.preferences;
if(val === 'timeHide' || val === 'done') {
var invert = _.invert(ref);
@ -376,6 +367,7 @@ Template.main.helpers({
return Session.get("newWork");
},
inRole() { // Checks correct permissions.
if(Session.get("currentWork") === null) return;
if(Session.get("newWork")) {
return true;
} else {

View File

@ -58,15 +58,6 @@ Template.profile.helpers({
}]
};
},
loadNew() {
if(Meteor.user().profile.preferences === undefined) {
var profile = Meteor.user().profile;
profile.preferences = defaults;
serverData = profile;
sendData("editProfile");
}
return;
},
mainCenter() { // Centers main div container.
var width = window.innerWidth * 1600 / 1920 + 10;
return "width:" + width.toString() + "px;margin-left:" + -0.5 * width.toString() + "px";

View File

@ -26,11 +26,4 @@ themeColors = {
}
};
defaults = {
"theme":"light",
"mode":"classes",
"timeHide":1,
"done": true
};
serverData = null;