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

62 lines
1,014 B
JavaScript
Raw Normal View History

2015-03-16 21:21:29 +00:00
(function(Sidebar, DotLockup){
2015-03-13 17:34:29 +00:00
// 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();
},
2015-03-16 21:21:29 +00:00
initializeDotLockup: function(){
new DotLockup();
},
2015-03-13 17:34:29 +00:00
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();
2015-03-16 21:21:29 +00:00
Init.initializeDotLockup();
2015-03-13 17:34:29 +00:00
Init.initializeWaypoints();
}
}
};
Init.start();
2015-03-16 21:21:29 +00:00
})(window.Sidebar, window.DotLockup);