summaryrefslogtreecommitdiff
path: root/client/button.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/button.js')
-rw-r--r--client/button.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/client/button.js b/client/button.js
index 29eeb91..d298ef7 100644
--- a/client/button.js
+++ b/client/button.js
@@ -15,6 +15,26 @@ Template.login.events({
}
});
+Template.dates.events({
+ 'submit form.dates': function (event) {
+ var month = $('input[name=monthOptions]:checked').val();
+ var year = $('input[name=yearOptions]:checked').val();
+ if (month !== undefined && year !== undefined) {
+ Meteor.call('getInstagramMedia', +year, +month, function(error, results) {
+ console.log('Instagram response', results.data)
+ Session.set('photos', results.data.data);
+ });
+ }
+ Router.go('photos');
+ return false;
+ }
+})
+
+Template.dates.helpers({
+ months: _.range(1, 13),
+ years: _.range(2012, 2016)
+})
+
Template.photos.helpers({
photos: function () {
return Session.get('photos');
@@ -22,9 +42,5 @@ Template.photos.helpers({
})
Accounts.onLogin(function() {
- // Meteor.call('getInstagramMedia', function(error, results) {
- // console.log('Instagram response', results.data)
- // Session.set('photos', results.data.data);
- // });
Router.go('dates');
});