fixed keyboard date switching

This commit is contained in:
Sacha Greif 2012-12-14 17:12:52 +09:00
parent e2d164d593
commit 8b7421b0d2
2 changed files with 3 additions and 3 deletions

View file

@ -33,10 +33,10 @@ Template.posts_digest.helpers({
Template.posts_digest.created = function(){ Template.posts_digest.created = function(){
var currentDate=moment(Session.get('currentDate')).startOf('day'); var currentDate=moment(Session.get('currentDate')).startOf('day');
var today=moment(new Date()).startOf('day'); var today=moment(new Date()).startOf('day');
$(document).bind('keydown', 'left', function(){ $(document).bind('keyup', 'left', function(){
Meteor.Router.to($('.prev-link').attr('href')); Meteor.Router.to($('.prev-link').attr('href'));
}); });
$(document).bind('keydown', 'right', function(){ $(document).bind('keyup', 'right', function(){
if(isAdmin(Meteor.user()) || today.diff(currentDate, 'days') > 0) if(isAdmin(Meteor.user()) || today.diff(currentDate, 'days') > 0)
Meteor.Router.to($('.next-link').attr('href')); Meteor.Router.to($('.next-link').attr('href'));
}); });

View file

@ -7,7 +7,7 @@ trackEvent = function(event, properties){
if(typeof mixpanel.track !== 'undefined'){ if(typeof mixpanel.track !== 'undefined'){
mixpanel.track(event, properties); mixpanel.track(event, properties);
} }
if(typeof GoSquared.DefaultTracker !== 'undefined'){ if(typeof GoSquared !== 'undefined' && typeof GoSquared.DefaultTracker !== 'undefined'){
GoSquared.DefaultTracker.TrackEvent(event, JSON.stringify(properties)); GoSquared.DefaultTracker.TrackEvent(event, JSON.stringify(properties));
} }
} }