Fixed request css and js

This commit is contained in:
Kenneth Jao 2016-09-09 08:20:51 -04:00
parent 1fb3d8f4d1
commit 7d90cd6871
3 changed files with 10 additions and 11 deletions

View File

@ -1135,8 +1135,8 @@ input, textarea {
#requests {
width: 25vw;
height: 9vw;
margin-bottom: -13.3vw;
height: 11vw;
margin-bottom: -15.3vw;
padding: 2vw;
border-top: 5px solid #852E6D;
@ -1187,12 +1187,12 @@ input, textarea {
#requests p {
margin: 0;
margin-bottom: 3%;
margin-bottom: 1vh;
}
#requests textarea {
width: 96%;
margin-bottom: 4%;
margin-bottom: 1.5vh;
}
#requestCont{

View File

@ -464,7 +464,7 @@ Template.main.events({
}
if(!document.getElementById("userDropdown").contains(event.target)) closeDivFade(document.getElementById("userDropdown"));
if(!document.getElementById("requests").contains(event.target)) document.getElementById("requests").style.marginBottom = "-13.3vw";
if(!document.getElementById("requests").contains(event.target)) document.getElementById("requests").style.marginBottom = "-15.3vw";
},
// MAIN MENU BUTTONS
'click .fa-bars' () { // Click menu button.
@ -575,16 +575,17 @@ Template.main.events({
var array = {};
array.content = area.value;
array.info = {
"users": Meteor.users,
"users": Meteor.users.find().fetch(),
"userInfo": Meteor.user(),
"userClasses": Session.get("calendarClasses")
};
Meteor.call("createRequest", array, function(err,result) {
area.value = "Request sent!";
setTimeout(function(){
document.getElementById("requests").style.marginBottom = "-13.3vw";
document.getElementById("requests").style.marginBottom = "-15.3vw";
area.value = "";
},1000);
Session.set("commentRestrict",null);
},750);
})
},
// HANDLING INPUT CHANGING

View File

@ -620,12 +620,10 @@ Meteor.methods({
}
},
'createRequest': function(request) {
if (request.length <= 500 && Meteor.userId() !== null &&
_.contains(['bug', 'feature'], request.type)) {
if (request.content.length <= 500 && Meteor.userId() !== null) {
requests.insert({
requestor: Meteor.userId(),
request: request.content,
type: request.type,
info: request.info,
timeRequested: new Date()
});