Alert on main page button click

This commit is contained in:
Kenneth Jao 2016-10-01 15:56:51 -04:00
parent 00221db2c8
commit 2797423008
3 changed files with 9 additions and 3 deletions

View File

@ -88,8 +88,7 @@
width: 80%; width: 80%;
margin: auto; margin: auto;
padding-top: 16vh; padding-top: 16vh;
background-color: rgba(0, 0, 0, 0.2); padding-bottom: 4vh;
padding-bottom: 4vh;
} }
.text { .text {

View File

@ -1,6 +1,6 @@
<template name="profile"> <template name="profile">
<div class="noScroll"> <div class="noScroll">
<div id="mainpage{{userProfile}}" onclick="window.location='/'"><h2>Main Page</h2></div> <div id="mainpage{{userProfile}}"><h2>Main Page</h2></div>
<div id="logout2" onclick='document.getElementById("login-buttons-logout").click();'><h2>Logout</h2></div> <div id="logout2" onclick='document.getElementById("login-buttons-logout").click();'><h2>Logout</h2></div>
<div id="profWrapper"> <div id="profWrapper">
<div id="profPage" style="background-color:{{divColor 'mainColor'}};min-width:{{screen}}{{textColor}}{{loadNew}}"> <div id="profPage" style="background-color:{{divColor 'mainColor'}};min-width:{{screen}}{{textColor}}{{loadNew}}">

View File

@ -202,6 +202,13 @@ Template.profile.events({
} }
}, },
// MAIN BUTTONS // MAIN BUTTONS
'click #mainpage' () {
if (!Meteor.userId() || _.contains([null, undefined, ""], Meteor.user().profile.school)) {
alert("Please fill in your profile!");
} else {
window.location = '/';
}
},
'click .addClass' () {  'click .addClass' () { 
if(Session.equals("profClassTab","addClass")) return;          if(Session.equals("profClassTab","addClass")) return;         
var functionHolder = document.getElementById("profClassInfoHolder"); var functionHolder = document.getElementById("profClassInfoHolder");