Skip to content
Snippets Groups Projects
Commit d575a78f authored by Chris Hallberg's avatar Chris Hallberg
Browse files

VuDL dynamic heights return with a simpler model.

parent 73d4a301
No related merge requests found
......@@ -130,6 +130,12 @@ function toggleSideNav() {
opener.toggleClass('hidden');
$('#view').toggleClass('col-sm-9').toggleClass('col-sm-12');
}
function resizeElements() {
$height = $(window).height() + window.scrollY - $('.panel:last-child').offset().top - 50;
$('.panel-collapse').css('max-height', Math.max(300, Math.min($height, $(window).height() - 200)));
}
// Ready? Let's go
$(document).ready(function() {
$('.page-link').click(function() {
......@@ -167,6 +173,8 @@ $(document).ready(function() {
}
}
});
scrollToSelected();
resizeElements();
$( window ).resize( resizeElements );
$( window ).scroll( resizeElements );
});
// Initial alignment
$( window ).load( scrollToSelected );
\ No newline at end of file
......@@ -31,6 +31,14 @@
}
}
function resizeZoom() {
$height = $(window).height() + window.scrollY - $('#zoomy').offset().top - 10;
$('#zoomy').css({
'width' : '100%',
'height': Math.max(400, Math.min($height, $('#side-nav').height() - 80))
});
}
$(document).ready(function() {
$('#view .nav-tabs li.opener a').addClass('hidden');
$('#view .nav-tabs li:not(.static) a').click(function (e) {
......@@ -39,15 +47,10 @@
currTab = $(this).attr('id');
});
// Initialize the size of Zoomy
$('#zoom-tab').on('shown.bs.tab', function(e) {
$('.loading-bar').removeClass('hidden');
$('#zoomy').css({
'width' : '100%',
'height': Math.ceil($('#side-nav').offset().top+$('#side-nav').height()-$('#zoomy').offset().top)
});
Zoomy.init(document.getElementById('zoomy'));
Zoomy.load(pageData['large'], function() { $('.loading-bar').addClass('hidden'); });
});
$('#zoom-tab').on('shown.bs.tab', resizeZoom);
$(window).scroll(resizeZoom);
$(window).resize(resizeZoom);
resizeZoom();
var pageData = {
'id' :'<?=$this->id ?>',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment