Removed defaults client side
This commit is contained in:
parent
876272ada9
commit
2b96ce9d4f
@ -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>
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -26,11 +26,4 @@ themeColors = {
|
||||
}
|
||||
};
|
||||
|
||||
defaults = {
|
||||
"theme":"light",
|
||||
"mode":"classes",
|
||||
"timeHide":1,
|
||||
"done": true
|
||||
};
|
||||
|
||||
serverData = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user