Fucking solved that scroll height bug
This commit is contained in:
		
							parent
							
								
									4a3abb6991
								
							
						
					
					
						commit
						2f4411472a
					
				@ -57,7 +57,9 @@
 | 
			
		||||
		<!-- END HEADER -->
 | 
			
		||||
		
 | 
			
		||||
		<!-- START DATA -->
 | 
			
		||||
		<div id="data-container" class="css-scrollbar"></div>
 | 
			
		||||
		<div id="data-container" class="css-scrollbar">
 | 
			
		||||
			<div class="inner"></div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<!-- END DATA -->
 | 
			
		||||
		
 | 
			
		||||
		<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">
 | 
			
		||||
	<form action="" method="post" id="search_form">
 | 
			
		||||
		<input type="text" id="search_field"/>
 | 
			
		||||
 | 
			
		||||
@ -14,25 +14,39 @@ var Ajax = {
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			Pages.renderArtist(data);
 | 
			
		||||
			beathaven.redrawScrollbar();
 | 
			
		||||
		})
 | 
			
		||||
	},
 | 
			
		||||
	
 | 
			
		||||
	loadSearchPage: function() {
 | 
			
		||||
		Ajax.setArchor('/search/');
 | 
			
		||||
		$.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() {
 | 
			
		||||
		$.get('/demo/whee.html', function(data){
 | 
			
		||||
			$('#data-container').html(data);
 | 
			
		||||
			$('#data-container .inner').html(data);
 | 
			
		||||
		})
 | 
			
		||||
	},
 | 
			
		||||
	
 | 
			
		||||
	load404Page: function() {
 | 
			
		||||
		$.get('/demo/404.html', function(data){
 | 
			
		||||
			$('#data-container').html(data);
 | 
			
		||||
			$('#data-container .inner').html(data);
 | 
			
		||||
			beathaven.redrawScrollbar();
 | 
			
		||||
		})
 | 
			
		||||
	},
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
@ -1,20 +1,39 @@
 | 
			
		||||
$(function(){
 | 
			
		||||
	beathaven.init();
 | 
			
		||||
	$(window).resize(beathaven.adjustSizes)
 | 
			
		||||
	window.setTimeout(beathaven.checkRedrawScrollbar, 500);
 | 
			
		||||
})
 | 
			
		||||
var beathaven = {
 | 
			
		||||
	
 | 
			
		||||
	last_height: false,
 | 
			
		||||
	
 | 
			
		||||
	init: function () {
 | 
			
		||||
		this.drawInterface();
 | 
			
		||||
		this.adjustSizes();
 | 
			
		||||
		Ajax.detectStartPage();
 | 
			
		||||
	},
 | 
			
		||||
	
 | 
			
		||||
	drawInterface: function() {
 | 
			
		||||
	},
 | 
			
		||||
	
 | 
			
		||||
	adjustSizes: function() {
 | 
			
		||||
		$('#data-container').height($(window).height() - $('#header-container').height());
 | 
			
		||||
		$('#data-container').width($(window).width() - $('#player').width()).scrollbar();
 | 
			
		||||
		$('#player-container').height($(window).height());
 | 
			
		||||
		$('#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>\
 | 
			
		||||
					</div>\
 | 
			
		||||
				</div>\
 | 
			
		||||
				<div class="kaboom"></div>\
 | 
			
		||||
				');
 | 
			
		||||
			
 | 
			
		||||
				$.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
 | 
			
		||||
            this.props.handleTop = {
 | 
			
		||||
                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)
 | 
			
		||||
 | 
			
		||||
@ -3,10 +3,12 @@
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	float: left;
 | 
			
		||||
	margin: 0 0 25px 0;
 | 
			
		||||
	clear: both;
 | 
			
		||||
}
 | 
			
		||||
.albums {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	float: left;
 | 
			
		||||
	clear: both;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Artist info block */
 | 
			
		||||
 | 
			
		||||
@ -124,6 +124,12 @@
 | 
			
		||||
	#error_page span {
 | 
			
		||||
		font-size: 24px;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
.kaboom {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	height: 30px;
 | 
			
		||||
	clear: both;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Colorizing *
 | 
			
		||||
#player-container	{ background-color: #CFC; }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user