1(function($) { 2 3 window.theme = { 4 5 init: function() { 6 7 window.theme.global.init(); 8 }, 9 10 _push_to_fullheight: function() { 11 var content_module_offset = $('#content').offset().top; 12 $('#content').css({'min-height':'calc(100vh - '+content_module_offset+'px)'}); 13 }, 14 15 global: { 16 17 init: function() { 18 if ($('.subsection-wrapper-cover, .record-page-content-combined .scroll_section_cover').length) { 19 $(window).resize(function() { 20 if ($('.record-page-content-combined .scroll_section_cover').length) { 21 22 // Reset css 23 $('#cover_page_slideshow').css("min-height", ""); 24 $('#cover_page_slideshow_caption').css({"bottom": "", "top": ""}); 25 $('#cover_page_slideshow_pager').show(); 26 27 var heading_wrapper_top_offset = $('.heading_wrapper').offset().top; 28 var object_height = $('.heading_wrapper').innerHeight() + heading_wrapper_top_offset; 29 30 if (object_height > window.innerHeight) { 31 $('#cover_page_slideshow').css("min-height", object_height); 32 } 33 34 if ($('#cover_page_slideshow_pager').length) { 35 var cover_page_slideshow_pager_top_offset = $('#cover_page_slideshow_pager').offset().top; 36 var subnav_top_offset = $('.heading_wrapper #sub_nav').offset().top; 37 var subnav_height = $('.heading_wrapper #sub_nav').innerHeight() + subnav_top_offset; 38 if (subnav_height >= cover_page_slideshow_pager_top_offset) { 39 $('#cover_page_slideshow_pager').hide(); 40 $('#cover_page_slideshow_caption').css({"bottom": "auto", "top": (object_height - 60)}); 41 } 42 } 43 44 } else { 45 var object_height = $('.heading_wrapper').height() + $('.heading_wrapper').offset().top; 46 if(object_height > window.innerHeight) { 47 // Temp Bug Fix.. The height of the elements was set as 100vh, on a small screen this meant that the menu was cut off, 48 // this code is meant to prevent this from happening. To reproduce the bug, set if False above so only the code in the else block gets run. 49 theme._push_to_fullheight('.subsection-wrapper-cover #content', 'min-height', 0, 99); 50 $('.subsection-wrapper-cover #cover_page_slideshow').css('min-height', object_height); 51 $('#cover_page_slideshow_pager').hide(); 52 } else { 53 $('#cover_page_slideshow_pager').show(); 54 theme._push_to_fullheight('.subsection-wrapper-cover #content', 'min-height', 0, 0); 55 theme._push_to_fullheight('.subsection-wrapper-cover #cover_page_slideshow', 'min-height', 0, 0); 56 } 57 } 58 }).trigger('resize'); 59 } 60 if ($('#image_gallery #image_container .image span img').length) { 61 function bindImageGalleryResize() { 62 $(window).resize(function() { 63 window.galleries.image_gallery.init(); 64 }).trigger('resize'); 65 } 66 if (window.galleries && window.galleries.image_gallery) { 67 bindImageGalleryResize(); 68 } else { 69 // module mode: defer until galleries_js_loader signals ready 70 var prevReady = window.modulesReady; 71 window.modulesReady = function() { 72 if (typeof prevReady === 'function') prevReady(); 73 if (window.galleries && window.galleries.image_gallery) { 74 bindImageGalleryResize(); 75 } 76 }; 77 } 78 } 79 } 80 81 } 82 83 }; 84 85 86 $(document).ready(function() { 87
88 window.theme.init(); 89 90 }); 91 92})(jQuery); 93 94
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.