42 lines
1.2 KiB
JavaScript
Raw Normal View History

2011-06-14 20:05:12 +04:00
$(function(){
2011-06-17 23:26:03 +04:00
if (document.location.host != 'beathaven.org' && document.location.host != 'localhost') {
document.location.href = 'http://beathaven.org/demo/';
}
2011-06-14 20:05:12 +04:00
beathaven.init();
$(window).resize(beathaven.adjustSizes)
2011-06-16 04:19:40 +04:00
window.setTimeout(beathaven.checkRedrawScrollbar, 500);
2011-06-14 20:05:12 +04:00
})
var beathaven = {
2011-06-16 04:19:40 +04:00
last_height: false,
2011-06-14 20:05:12 +04:00
init: function () {
this.drawInterface();
this.adjustSizes();
2011-06-17 19:13:47 +04:00
Ajax.detectPage();
2011-06-14 20:05:12 +04:00
},
2011-06-16 04:19:40 +04:00
2011-06-14 20:05:12 +04:00
drawInterface: function() {
},
2011-06-16 04:19:40 +04:00
2011-06-14 20:05:12 +04:00
adjustSizes: function() {
$('#data-container').height($(window).height() - $('#header-container').height());
2011-06-15 05:42:50 +04:00
$('#data-container').width($(window).width() - $('#player').width()).scrollbar();
2011-06-14 20:05:12 +04:00
$('#player-container').height($(window).height());
2011-06-15 05:42:50 +04:00
$('#playlist').height($(window).height() - $('#player').height()).scrollbar();
2011-06-16 04:19:40 +04:00
},
checkRedrawScrollbar: function() {
var outer_height = $('#data-container > div').outerHeight();
if (outer_height > 300 && outer_height != beathaven.last_height) {
beathaven.last_height = outer_height;
beathaven.redrawScrollbar();
}
window.setTimeout(beathaven.checkRedrawScrollbar, 500);
},
redrawScrollbar: function() {
$('#data-container').html($('#data-container').find('.inner').first());
$('#data-container').scrollbar();
2011-06-14 20:05:12 +04:00
}
}