Renaming and small optmization
This commit is contained in:
parent
bded6702cf
commit
f95b53db08
0
hourglass/client/admin/admin.css
Normal file
0
hourglass/client/admin/admin.css
Normal file
0
hourglass/client/admin/admin.html
Normal file
0
hourglass/client/admin/admin.html
Normal file
0
hourglass/client/admin/admin.js
Normal file
0
hourglass/client/admin/admin.js
Normal file
@ -171,9 +171,9 @@ Template.main.helpers({
|
||||
return " - " + Meteor.user().profile.school;
|
||||
},
|
||||
iconColor(icon) { // Sidebar status color
|
||||
if (Session.get("sidebar") === icon + "Container") {
|
||||
if (Session.equals("sidebar",icon + "Container")) {
|
||||
return themeColors[Meteor.user().profile.preferences.theme].statusIcons;
|
||||
} else if (Session.get("sidebar") === "both") {
|
||||
} else if (Session.equals("sidebar","both")) {
|
||||
return themeColors[Meteor.user().profile.preferences.theme].statusIcons;
|
||||
} else {
|
||||
return;
|
||||
@ -192,25 +192,25 @@ Template.main.helpers({
|
||||
return pic;
|
||||
},
|
||||
menuStatus() { // Status of of menu sidebar.
|
||||
if (Session.get("sidebar") === "menuContainer") {
|
||||
if (Session.equals("sidebar","menuContainer")) {
|
||||
return "0%";
|
||||
} else if (Session.get("sidebar") === "both") {
|
||||
} else if (Session.equals("sidebar","both")) {
|
||||
return "0%";
|
||||
} else {
|
||||
return openValues.menu;
|
||||
}
|
||||
},
|
||||
optionsStatus() { // Status of options sidebar.
|
||||
if (Session.get("sidebar") === "optionsContainer") {
|
||||
if (Session.equals("sidebar","optionsContainer")) {
|
||||
return "0%";
|
||||
} else if (Session.get("sidebar") === "both") {
|
||||
} else if (Session.equals("sidebar","both")) {
|
||||
return "0%";
|
||||
} else {
|
||||
return openValues.options;
|
||||
}
|
||||
},
|
||||
modeStatus(status) { // Color status of display modes.
|
||||
if (status === Session.get("mode")) {
|
||||
if (Session.equals("mode",status)) {
|
||||
return themeColors[Meteor.user().profile.preferences.theme].highlightText;
|
||||
} else {
|
||||
return;
|
||||
@ -344,16 +344,16 @@ Template.main.helpers({
|
||||
},
|
||||
commentDim() { // Dimensions of comment container.
|
||||
var work = Session.get("currentWork");
|
||||
if(Session.get("newWork") === null || work === null) return;
|
||||
if(Session.equals("newWork",null) || work === null) return;
|
||||
if(Session.get("newWork") || work.comments.length <= 3) return;
|
||||
return 0.23*window.innerHeight.toString() + "px";
|
||||
},
|
||||
work(value) { // Returns the specified work value.
|
||||
if(Session.get("currentWork") === null) return;
|
||||
if(Session.equals("currentWork",null)) return;
|
||||
return Session.get("currentReadableWork")[value];
|
||||
},
|
||||
workType() { // Returns color for respective work type.
|
||||
if(Session.get("currentWork") === null) return;
|
||||
if(Session.equals("currentWork",null)) return;
|
||||
if(Session.get("currentWork").type === undefined) return;
|
||||
type = Session.get("currentWork").type;
|
||||
if(type.includes("edit")) {
|
||||
@ -369,7 +369,7 @@ Template.main.helpers({
|
||||
return Session.get("newWork");
|
||||
},
|
||||
inRole() { // Checks correct permissions.
|
||||
if(Session.get("currentWork") === null) return;
|
||||
if(Session.equals("currentWork",null)) return;
|
||||
if(Session.get("newWork")) {
|
||||
return true;
|
||||
} else {
|
||||
@ -401,7 +401,7 @@ Template.main.events({
|
||||
closeInput(modifyingInput);
|
||||
}
|
||||
|
||||
if (e !== Session.get("sidebar") && // Sidebar closing.
|
||||
if (!Session.equals("sidebar",e) && // Sidebar closing.
|
||||
!e.includes("fa-cog") &&
|
||||
!e.includes("fa-bars") &&
|
||||
!document.getElementById("menuContainer").contains(event.target) &&
|
||||
@ -474,7 +474,7 @@ Template.main.events({
|
||||
}
|
||||
},
|
||||
'click .classes' () { // Click classes mode button.
|
||||
if (Session.get("mode") === "classes") return;
|
||||
if (Session.equals("mode","classes")) return;
|
||||
var modeHolder = document.getElementById("mainBody");
|
||||
closeDivFade(modeHolder);
|
||||
setTimeout(function() {
|
||||
@ -484,7 +484,7 @@ Template.main.events({
|
||||
Session.set("sidebar",null); // Closes all sidebars.
|
||||
},
|
||||
'click .calendar' () { // Click calendar mode button.
|
||||
if (Session.get("mode") === "calendar") return;
|
||||
if (Session.equals("mode","calendar")) return;
|
||||
var modeHolder = document.getElementById("mainBody");
|
||||
closeDivFade(modeHolder);
|
||||
setTimeout(function() {
|
||||
|
||||
@ -149,14 +149,14 @@ Template.profile.helpers({
|
||||
},
|
||||
profClassTabColor(status) { // Change this [Supposed to show the current mode that's selected via color]
|
||||
|
||||
if (status === Session.get("profClassTab")) {
|
||||
if (Session.equals("profClassTab",status)) {
|
||||
return themeColors[Meteor.user().profile.preferences.theme].highlightText;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
},
|
||||
profClassTab(tab) { // Tells current class
|
||||
if (tab === Session.get("profClassTab")) {
|
||||
if (Session.get("profClassTab",tab)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -178,7 +178,7 @@ Template.profile.helpers({
|
||||
return Session.get("confirmText");
|
||||
},
|
||||
selectedClass(val) { // Returns values for selectedClass
|
||||
if(Session.get("selectClassId") === null) return;
|
||||
if(Session.equals("selectClassId",null)) return;
|
||||
var usertype = ["moderators","banned"];
|
||||
var attribute = Session.get("selectClassId");
|
||||
var array = classes.findOne({_id:attribute});
|
||||
@ -232,7 +232,7 @@ Template.profile.events({
|
||||
}
|
||||
}
|
||||
if(!document.getElementById("createdClasses").contains(event.target) &&
|
||||
Session.get("code") !== null &&
|
||||
!Session.equals("code",null) &&
|
||||
!event.target.className.includes("fa-times-circle-o")) {
|
||||
document.getElementById("createdClasses").style.marginRight = "-40%";
|
||||
}
|
||||
@ -276,7 +276,7 @@ Template.profile.events({
|
||||
},
|
||||
'click .classBox' (event) { // When you click on a box that holds class
|
||||
if (event.target.id === "label" ||
|
||||
Session.get("profClassTab") === "manClass" ||
|
||||
Session.equals("profClassTab","manClass") ||
|
||||
event.target.className.includes("fa-times")) return;
|
||||
|
||||
if (event.target.className !== "classBox") {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user