mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
21 lines
No EOL
593 B
JavaScript
21 lines
No EOL
593 B
JavaScript
Template.body.events({
|
|
'click a[href]': function(event) {
|
|
var url = $(event.target).closest('a').attr('href').replace(/#.*$/, '');
|
|
if (url && url[0] === '/' && url !== document.location.href) {
|
|
event.preventDefault();
|
|
Router.navigate(url, {trigger: true});
|
|
$('body').removeClass('mobile-nav-open');
|
|
}
|
|
}
|
|
});
|
|
|
|
Template.body.created = function(){
|
|
Session.set('currentScroll', null);
|
|
}
|
|
|
|
Template.body.rendered = function(){
|
|
if(currentScroll=Session.get('currentScroll')){
|
|
console.log(currentScroll);
|
|
$('body').scrollTop(currentScroll);
|
|
}
|
|
} |