PageSourceSearch

https://tapestrycapital.ca/wp-content/themes/bb-theme-child/compon…/featured-card.js?ver=1498491855

js tapestrycapital.ca collected 2026-10-02 17:41:40 UTC 5,551 bytes, 129 lines download raw bytes

1jQuery(document).ready(function ($) {
2    console.log('featured-cards.js ready');
3
4    
5        
6
7        $("body:not(.fl-builder-edit) .featured_expandable_item").each(function(){
8            
9            
10            $item_height_title= parseInt($(this).find(".card-carousel-title").css("height"))
11            $item_height_icon = parseInt($(this).find(".card-carousel-icon").css("height"))
12            $item_height_txt = parseInt($(this).find(".card-carousel-txt").css("height"))
13            $item_height_cta = parseInt($(this).find(".card-carousel-cta").css("height"))
14
15            //$item_height = $item_height_title + $item_height_icon +$item_height_txt + $item_height_cta
16            $item_height = parseInt($(this).css("height"))
17            $header_height = $item_height_title + $item_height_icon 
18
19            // console.log($item_height_title)
20            // console.log($item_height_icon)
21            // console.log($item_height_txt)
22            // console.log($item_height_cta)
23            // console.log("--")
24
25            $img_height = parseInt($(this).find(".card-carousel-img").css("height"));
26
27            // console.log($item_height + " // " + $img_height)
28            $(this).find(".card-carousel-img").css("height", $item_height-$header_height  + "px")
29
30
31            $(this).find(".card-carousel-cta a").focus(function(){
32                $(this).parents(".featured_expandable_item").find(".card-carousel-img").addClass("active")
33            })
34            $(this).find(".card-carousel-cta a").blur(function(){
35                $(this).parents(".featured_expandable_item").find(".card-carousel-img").removeClass("active")
36            })
37                
38        })
39
40    function hideimg() {
41        if ($(window).width()<1366)
42            $(".featured_expandable_item").addClass("hideimg")
43        else
44            $(".featured_expandable_item").removeClass("hideimg")
45    }
46    hideimg()
47
48
49
50    ///////////////////
51    // WINDOW RESIZE //
52    ///////////////////
53    $(window).on( "resize", function() {
54        hideimg()
55    });        
56
57})
58/* ============================================================================
59   Partner QA — arrow-only navigation for Scrolling Rows on phones (<=768px).
60   Touch gestures remain available to the page for normal vertical scrolling;
61   the cards themselves move only when one of the navigation buttons is used.
62   Desktop/tablet behaviour is unchanged.
63   ========================================================================= */
64;(function(){
65    var mq = window.matchMedia('(max-width: 768px)');
66
67    // header: while the "Want To Invest?" tab is hidden, flag the header so
68    // mobile CSS can collapse the top gap reserved for it; if the tab is ever
69    // unhidden the flag (and the normal offset) come back by themselves.
70    function flagWantto(){
71        var h = document.querySelector('header.fl-page-header');
72        if (!h) return;
73        var w = h.querySelector('.wantto');
74        var hidden = !w || getComputedStyle(w).display === 'none';
75        h.classList.toggle('wantto_hidden', hidden);
76    }
77
78    function cardStep(sc){
79        var cards = sc.querySelectorAll(':scope > .scrolling_row_website');
80        if (cards.length > 1) return cards[1].offsetLeft - cards[0].offsetLeft;
81        return cards.length ? cards[0].getBoundingClientRect().width : sc.clientWidth;
82    }
83    function updateButtons(sc, controls){
84        var max = Math.max(0, sc.scrollWidth - sc.clientWidth);
85        controls.querySelector('.scrolling-row-prev').disabled = sc.scrollLeft <= 1;
86        controls.querySelector('.scrolling-row-next').disabled = sc.scrollLeft >= max - 1;
87        controls.hidden = !mq.matches || max < 2;
88    }
89    function addControls(sc){
90        if (sc._arrowControls) return;
91
92        var controls = document.createElement('div');
93        controls.className = 'scrolling-row-controls';
94        controls.innerHTML =
95            '<button class="scrolling-row-prev" type="button" aria-label="Previous story">' +
96                '<img src="/wp-content/uploads/circle-arrow-left-white.svg" alt="">' +
97            '</button>' +
98            '<button class="scrolling-row-next" type="button" aria-label="Next story">' +
99                '<img src="/wp-content/uploads/circle-arrow-right-white.svg" alt="">' +
100            '</button>';
101        sc.insertAdjacentElement('beforebegin', controls);
102        sc._arrowControls = controls;
103
104        controls.querySelector('.scrolling-row-prev').addEventListener('click', function(){
105            sc.scrollBy({ left: -cardStep(sc), behavior: 'smooth' });
106        });
107        controls.querySelector('.scrolling-row-next').addEventListener('click', function(){
108            sc.scrollBy({ left: cardStep(sc), behavior: 'smooth' });
109        });
110        sc.addEventListener('scroll', function(){ updateButtons(sc, controls); }, { passive: true });
111        updateButtons(sc, controls);
112    }
113    function setup(){
114        flagWantto();
115        document.querySelectorAll('.scrolling_row_scroller').forEach(addControl
115s);
116        document.querySelectorAll('.scrolling_row_scroller').forEach(function(sc){
117            updateButtons(sc, sc._arrowControls);
118        });
119    }
120    function refresh(){ setup(); }
121    window.addEventListener('resize', refresh, { passive: true });
122    if (mq.addEventListener) mq.addEventListener('change', refresh);
123    if (document.readyState === 'loading') {
124        document.addEventListener('DOMContentLoaded', setup);
125    } else {
126        setup();
127    }
128    window.addEventListener('load', refresh);
129})();

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.