1"use strict"; 2 3(function(window, $) { 4 var page_wrap_selector = "#pageContainer"; 5 var page_content_selector = "#pageContent"; 6 var footer_selector = "footer"; 7 var top_header_selector = "#topHeader"; 8 var logo_selector = "#pageHeader .logo"; 9 10 // function to call only once, after the events have finished: 11 var waitForFinalEvent = (function() { 12 var timers = {}; 13 return function(callback, ms, uniqueId) { 14 if (timers[uniqueId]) { 15 window.clearTimeout(timers[uniqueId]); 16 } 17 timers[uniqueId] = window.setTimeout(callback, ms); 18 }; 19 })(); 20 21 $(document).ready(function() { 22 var $page_wrap = $(page_wrap_selector); 23 var $page_content = $(page_content_selector); 24 var $footer = $(footer_selector); 25 var $top_header = $(top_header_selector); 26 var $logo = $(logo_selector); 27 28 var page_wrap_height_func = function() { 29 return ( 30 $page_wrap.outerHeight() - 31 parseInt($page_content.css("padding-bottom")) + 32 parseInt($("body").css("padding-top")) 33 ); 34 }; 35 36 var height_exclude = function() { 37 //return $footer.outerHeight() - $top_header.height(); 38 return $footer.outerHeight() + $("#pageContainerSpacer").height(); 39 }; 40 41 var page_wrap_height_diff = function(window_height, page_wrap_height) { 42 return window_height - page_wrap_height - height_exclude(); 43 }; 44 45 //if content does not fill the page, adjust the height so that it does 46 // adds to #page_wrap padding-bottom to fill out page: 47 var resize_page_wrap = function() { 48 var page_wrap_height = page_wrap_height_func(); 49 if ($(window).height() > page_wrap_height) { 50 var add_height = page_wrap_height_diff( 51 $(window).height(), 52 page_wrap_height 53 ); 54 $page_content.css("padding-bottom", add_height); 55 } 56 }; 57 58 var space_top_header = function() { 59 $("body").css("padding-top", $top_header.height() + "px"); 60 }; 61 62 var check_logo_ratio = function() { 63 // if width is 100%, assume that height might be stretched 64 if ($logo.width() === $logo.parents(".page-header-left").width()) { 65 // unset the height: 66 $logo.css("width", "100%"); 67 $logo.css("height", "auto"); 68 69 // also can reset page-header-right 70 $logo 71 .parents(".page-header-left") 72 .siblings(".page-header-right") 73 .css( 74 "min-height", 75 $logo.parents(".page-header-left").height() + "px" 76 ); 77 } 78 }; 79 80 var resize_page = function() { 81 resize_page_wrap(); 82 space_top_header(); 83 check_logo_ratio(); 84 }; 85 86 // on page load:
87 resize_page(); 88 89 // resize again if windor is resized 90 $(window).resize(function() { 91 waitForFinalEvent(resize_page, 500, "page_wrap_resizing"); 92 }); 93 94 check_logo_ratio(); 95 $logo.load(function() { 96 check_logo_ratio(); 97 }); 98 99 var $first_slide = $(".swiper-slide img").first(); 100 $first_slide.load(function() { 101 resize_page(); 102 }); 103 }); 104})(window, jQuery); 105 106// this nullifies functions from template-storeapp/ja/template.js 107function isIOSIframe() { 108 return false; 109}
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.