Fucking solved that scroll height bug
This commit is contained in:
parent
4a3abb6991
commit
2f4411472a
@ -57,7 +57,9 @@
|
|||||||
<!-- END HEADER -->
|
<!-- END HEADER -->
|
||||||
|
|
||||||
<!-- START DATA -->
|
<!-- START DATA -->
|
||||||
<div id="data-container" class="css-scrollbar"></div>
|
<div id="data-container" class="css-scrollbar">
|
||||||
|
<div class="inner"></div>
|
||||||
|
</div>
|
||||||
<!-- END DATA -->
|
<!-- END DATA -->
|
||||||
|
|
||||||
<div id="vk_api_transport"></div>
|
<div id="vk_api_transport"></div>
|
||||||
|
@ -1,16 +1,3 @@
|
|||||||
<script type="text/javascript">
|
|
||||||
$('#search_field').autocomplete({
|
|
||||||
serviceUrl: '/artist/autocomplete', // Страница для обработки запросов автозаполнения
|
|
||||||
minChars: 2, // Минимальная длина запроса для срабатывания автозаполнения
|
|
||||||
delimiter: /(,|;)\s*/, // Разделитель для нескольких запросов, символ или регулярное выражение
|
|
||||||
maxHeight: 400, // Максимальная высота списка подсказок, в пикселях
|
|
||||||
width: 415, // Ширина списка
|
|
||||||
zIndex: 9999, // z-index списка
|
|
||||||
deferRequestBy: 150, // Задержка запроса (мсек)
|
|
||||||
onSelect: Ajax.loadArtistData
|
|
||||||
});
|
|
||||||
$('#search_field').focus();
|
|
||||||
</script>
|
|
||||||
<div id="search-container">
|
<div id="search-container">
|
||||||
<form action="" method="post" id="search_form">
|
<form action="" method="post" id="search_form">
|
||||||
<input type="text" id="search_field"/>
|
<input type="text" id="search_field"/>
|
||||||
|
@ -14,25 +14,39 @@ var Ajax = {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Pages.renderArtist(data);
|
Pages.renderArtist(data);
|
||||||
|
beathaven.redrawScrollbar();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
loadSearchPage: function() {
|
loadSearchPage: function() {
|
||||||
Ajax.setArchor('/search/');
|
Ajax.setArchor('/search/');
|
||||||
$.get('/demo/search.html', function(data){
|
$.get('/demo/search.html', function(data){
|
||||||
$('#data-container').html(data);
|
$('#data-container .inner').html(data);
|
||||||
|
beathaven.redrawScrollbar();
|
||||||
|
$('#search_field').autocomplete({
|
||||||
|
serviceUrl: '/artist/autocomplete', // Страница для обработки запросов автозаполнения
|
||||||
|
minChars: 2, // Минимальная длина запроса для срабатывания автозаполнения
|
||||||
|
delimiter: /(,|;)\s*/, // Разделитель для нескольких запросов, символ или регулярное выражение
|
||||||
|
maxHeight: 400, // Максимальная высота списка подсказок, в пикселях
|
||||||
|
width: 415, // Ширина списка
|
||||||
|
zIndex: 9999, // z-index списка
|
||||||
|
deferRequestBy: 150, // Задержка запроса (мсек)
|
||||||
|
onSelect: Ajax.loadArtistData
|
||||||
|
});
|
||||||
|
$('#search_field').focus();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
loadWheePage: function() {
|
loadWheePage: function() {
|
||||||
$.get('/demo/whee.html', function(data){
|
$.get('/demo/whee.html', function(data){
|
||||||
$('#data-container').html(data);
|
$('#data-container .inner').html(data);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
load404Page: function() {
|
load404Page: function() {
|
||||||
$.get('/demo/404.html', function(data){
|
$.get('/demo/404.html', function(data){
|
||||||
$('#data-container').html(data);
|
$('#data-container .inner').html(data);
|
||||||
|
beathaven.redrawScrollbar();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,20 +1,39 @@
|
|||||||
$(function(){
|
$(function(){
|
||||||
beathaven.init();
|
beathaven.init();
|
||||||
$(window).resize(beathaven.adjustSizes)
|
$(window).resize(beathaven.adjustSizes)
|
||||||
|
window.setTimeout(beathaven.checkRedrawScrollbar, 500);
|
||||||
})
|
})
|
||||||
var beathaven = {
|
var beathaven = {
|
||||||
|
|
||||||
|
last_height: false,
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
this.drawInterface();
|
this.drawInterface();
|
||||||
this.adjustSizes();
|
this.adjustSizes();
|
||||||
Ajax.detectStartPage();
|
Ajax.detectStartPage();
|
||||||
},
|
},
|
||||||
|
|
||||||
drawInterface: function() {
|
drawInterface: function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
adjustSizes: function() {
|
adjustSizes: function() {
|
||||||
$('#data-container').height($(window).height() - $('#header-container').height());
|
$('#data-container').height($(window).height() - $('#header-container').height());
|
||||||
$('#data-container').width($(window).width() - $('#player').width()).scrollbar();
|
$('#data-container').width($(window).width() - $('#player').width()).scrollbar();
|
||||||
$('#player-container').height($(window).height());
|
$('#player-container').height($(window).height());
|
||||||
$('#playlist').height($(window).height() - $('#player').height()).scrollbar();
|
$('#playlist').height($(window).height() - $('#player').height()).scrollbar();
|
||||||
|
},
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,6 +30,7 @@ var Pages = {
|
|||||||
</ul>\
|
</ul>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>\
|
</div>\
|
||||||
|
<div class="kaboom"></div>\
|
||||||
');
|
');
|
||||||
|
|
||||||
$.each(album.tracks.album, function(i, track){
|
$.each(album.tracks.album, function(i, track){
|
||||||
@ -51,6 +52,6 @@ var Pages = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#data-container').html('').append(artist_info).append(albums_info).scrollbar();
|
$('#data-container .inner').html('').append(artist_info).append(albums_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -257,7 +257,7 @@
|
|||||||
// min- and max-range for handle
|
// min- and max-range for handle
|
||||||
this.props.handleTop = {
|
this.props.handleTop = {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: this.props.handleContainerHeight - this.props.handleHeight
|
max: (this.props.handleContainerHeight - this.props.handleHeight)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ratio of handle-container-height to content-container-height (to calculate position of content related to position of handle)
|
// ratio of handle-container-height to content-container-height (to calculate position of content related to position of handle)
|
||||||
|
@ -3,10 +3,12 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0 0 25px 0;
|
margin: 0 0 25px 0;
|
||||||
|
clear: both;
|
||||||
}
|
}
|
||||||
.albums {
|
.albums {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
float: left;
|
float: left;
|
||||||
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Artist info block */
|
/* Artist info block */
|
||||||
|
@ -124,6 +124,12 @@
|
|||||||
#error_page span {
|
#error_page span {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.kaboom {
|
||||||
|
width: 100%;
|
||||||
|
height: 30px;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
/* Colorizing *
|
/* Colorizing *
|
||||||
#player-container { background-color: #CFC; }
|
#player-container { background-color: #CFC; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user