Cleaned up code, and optmized function

This commit is contained in:
Kenneth Jao 2017-10-23 22:28:15 -04:00
parent c846da2ab8
commit d37aa3738d
2 changed files with 1 additions and 21 deletions

View File

@ -9,7 +9,6 @@
ga('create', 'UA-40611162-4', 'auto'); ga('create', 'UA-40611162-4', 'auto');
ga('send', 'pageview'); ga('send', 'pageview');
</script> </script>
</head> </head>
@ -21,7 +20,6 @@
{{/if}} {{/if}}
</body> </body>
<template name="day"> <template name="day">
<p class="type">{{aftertext}} </p><p class="date">{{pretext}}</p> <p class="other">{{other}}</p> <p class="type">{{aftertext}} </p><p class="date">{{pretext}}</p> <p class="other">{{other}}</p>
{{#if allowed}} {{#if allowed}}
@ -44,7 +42,6 @@
{{> sidebar}} {{> sidebar}}
</div> </div>
<div class="scheduleList"> <div class="scheduleList">
{{#each mostrecent}} {{#each mostrecent}}
{{> recent}} {{> recent}}
{{/each}} {{/each}}

View File

@ -8,7 +8,6 @@ currentcard = 0;
Meteor.subscribe('schedule'); Meteor.subscribe('schedule');
Template.client.helpers({ Template.client.helpers({
sched: function() { sched: function() {
beforeslice = schedule.find({}, { beforeslice = schedule.find({}, {
sort: { sort: {
@ -18,7 +17,6 @@ Template.client.helpers({
}).fetch(); }).fetch();
return beforeslice.slice(1, beforeslice.length); return beforeslice.slice(1, beforeslice.length);
}, },
mostrecent: function() { mostrecent: function() {
return schedule.find({}, { return schedule.find({}, {
sort: { sort: {
@ -40,7 +38,6 @@ Template.client.events({
document.getElementById("other").value = ""; document.getElementById("other").value = "";
Meteor.call('add_button', this, pre, post, day, other); Meteor.call('add_button', this, pre, post, day, other);
}, },
"keypress input": function(event) { "keypress input": function(event) {
if (event.keyCode === 13) { if (event.keyCode === 13) {
pre = document.getElementById("date").value; pre = document.getElementById("date").value;
@ -51,7 +48,6 @@ Template.client.events({
Meteor.call('add_button', this, pre, post, day, other); Meteor.call('add_button', this, pre, post, day, other);
} }
}, },
"click .pulltab": function() { "click .pulltab": function() {
clicked = !clicked; clicked = !clicked;
Session.set("sidebar", clicked); Session.set("sidebar", clicked);
@ -62,7 +58,6 @@ Template.client.events({
.css("-moz-transform", "translateX(117%)") .css("-moz-transform", "translateX(117%)")
.css("-ms-transform", "translateX(117%)") .css("-ms-transform", "translateX(117%)")
.css("transform", "translateX(117%)"); .css("transform", "translateX(117%)");
} else { } else {
$(".pulltab").css("border-left", "40px solid #FF746B").css("margin-left", "0"); $(".pulltab").css("border-left", "40px solid #FF746B").css("margin-left", "0");
$(".scale") $(".scale")
@ -90,21 +85,14 @@ Template.day.helpers({
} }
return date return date
}, },
aftertext: function() { aftertext: function() {
return this.aftertext; return this.aftertext;
}, },
other: function() { other: function() {
return this.other; return this.other;
}, },
allowed: function() { allowed: function() {
if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) { return (Meteor.user() !== undefined && Meteor.user().services.google.email in allowedu);
return true;
} else {
return false;
}
} }
}); });
@ -112,7 +100,6 @@ Template.day.events({
'click .fa': function() { 'click .fa': function() {
Meteor.call('remove', this); Meteor.call('remove', this);
}, },
'click .eachDay': function() { 'click .eachDay': function() {
var user_id = Session.get('user_id') var user_id = Session.get('user_id')
console.log(user_id); console.log(user_id);
@ -141,15 +128,12 @@ Template.recent.helpers({
} }
return date return date
}, },
aftertext: function() { aftertext: function() {
return this.aftertext; return this.aftertext;
}, },
other: function() { other: function() {
return this.other; return this.other;
}, },
allowed: function() { allowed: function() {
if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) { if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) {
return true; return true;
@ -197,7 +181,6 @@ function getScale(index, start) {
return Math.abs(index-start) * -0.2 + 1.5 return Math.abs(index-start) * -0.2 + 1.5
}*/ }*/
Template.phone.helpers({ Template.phone.helpers({
phone: function() { phone: function() {
return schedule.find({}, { return schedule.find({}, {