open-vault/website/source/assets/javascripts/app/Init.js

57 lines
896 B
JavaScript
Raw Normal View History

2015-03-13 17:34:29 +00:00
(function(Sidebar){
// Quick and dirty IE detection
var isIE = (function(){
if (window.navigator.userAgent.match('Trident')) {
return true;
} else {
return false;
}
})();
// isIE = true;
var Init = {
start: function(){
var id = document.body.id.toLowerCase();
if (this.Pages[id]) {
this.Pages[id]();
}
},
initializeSidebar: function(){
new Sidebar();
},
initializeWaypoints: function(){
$('#header').waypoint(function(event, direction) {
$(this.element).addClass('showit');
}, {
offset: function() {
2015-03-15 00:37:22 +00:00
return '25%';
2015-03-13 17:34:29 +00:00
}
});
$('#hero').waypoint(function(event, direction) {
$(this.element).addClass('showit');
}, {
offset: function() {
2015-03-15 00:37:22 +00:00
return '25%';
2015-03-13 17:34:29 +00:00
}
});
},
Pages: {
'page-home': function(){
Init.initializeSidebar();
Init.initializeWaypoints();
}
}
};
Init.start();
})(window.Sidebar);