1/** 2 * Component Capital Projects 3 * @module CapitalProjects 4 * @param {jQuery} $ Instance of jQuery 5 * @return {Object} List of archive methods 6 */ 7XA.component.capitalprojects = (function($) { 8 /** 9 * This object stores all public api methods 10 * @type {Object.<Methods>} 11 * @memberOf module:CapitalProjects 12 * */ 13 var api = {}; 14 15 api.init = function() { 16 // body = capitalprojects-microsite 17 // selector: body.capitalprojects-microsite 18 const $vpWidth = $('body').width(); 19 const $headerImage = "body.capitalprojects-microsite .image.hero-header-component"; 20 const $headerTitle = "body.capitalprojects-microsite .container.content-title-wrapper"; // .content.hero-header-component 21 22 // Set header height 23 const $headerTitleHeight = $($headerTitle).find('.component.title-h1').height(); 24 25 let $headerTitleHeightClass; 26 27 if ($vpWidth > 1115) { 28 if ($headerTitleHeight > 338) { 29 $headerTitleHeightClass = 'ht-4'; 30 } 31 else if ($headerTitleHeight > 272) { 32 $headerTitleHeightClass = 'ht-3'; 33 } 34 } 35 else if ($vpWidth > 768 && $vpWidth < 1115) { 36 if ($headerTitleHeight > 338) { 37 $headerTitleHeightClass = 'ht-4'; 38 } 39 else if ($headerTitleHeight > 226) { 40 $headerTitleHeightClass = 'ht-3'; 41 } 42 } 43 else if ($vpWidth < 768) { 44 if ($headerTitleHeight > 224) { 45 $headerTitleHeightClass = 'ht-5'; 46 } 47 else if ($headerTitleHeight > 168) { 48 $headerTitleHeightClass = 'ht-4'; 49 } 50 else if ($headerTitleHeight > 112) { 51 $headerTitleHeightClass = 'ht-3'; 52 } 53 } 54 55 // Set Header Image Height 56 if ($headerTitleHeightClass) { 57 $($headerImage).addClass($headerTitleHeightClass); 58 $($headerTitle).addClass($headerTitleHeightClass); 59 } 60 }; 61 62 return api; 63})(jQuery, document); 64 65XA.register("capitalprojects", XA.component.capitalprojects);
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.