Commit b34c4948 authored by Manuel Gauto's avatar Manuel Gauto

Start on making tabs work

parent 8638d616
......@@ -8,7 +8,7 @@ meteor-base@1.0.4 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.12 # The database Meteor supports right now
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
session@1.1.6 # Client-side reactive dictionary for your app
session # Client-side reactive dictionary for your app
jquery@1.11.9 # Helpful client-side library
tracker@1.1.0 # Meteor's client-side reactive programming library
......
<head>
<meta charset="utf-8">
<meta name="description" content="SRCT Weather beautifully displays live weather and forecasts for Mason's campuses.">
<title>SRCT Weather &bull; 76&#176; F</title>
<title>SRCT Weather</title>
<link rel="stylesheet" href="weather.css">
<link rel="icon" type="image/x-icon" href="lib/favicon.ico" />
</head>
......
Template.home.events({
'click .locationTab' (event) {
'click' (event) {
console.log(event);
}
});
......@@ -31,9 +31,16 @@ Template.weather.helpers({
var weatherData = {};
var weatherDataDependency = new Tracker.Dependency;
Template.weather.onCreated(function(){
Meteor.call('getWeather', 38.830295, -77.307717, function(error, result) {
weatherData = result;
weatherDataDependency.changed();
Session.set("locationName", "FAIRFAX");
Tracker.autorun(function () {
var locName = Session.get("locationName");
var location = LOCATIONS[locName];
Meteor.call('getWeather', location.lat, location.long, function(error, result) {
weatherData = result;
document.title = "SRCT Weather • "+Math.round(result.data.currently.temperature)+"° F"
weatherDataDependency.changed();
});
});
});
......
......@@ -33,6 +33,7 @@ function getWeather(latitude, longitude) {
return curWeatherData;
}
} else {
console.log("Returning cached data.")
//The data is still valid, return it
return curWeatherData;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment