PageSourceSearch

https://sterlingcapital.com/assets/js/site.js?v=1790362289

js sterlingcapital.com collected 2026-09-25 18:51:39 UTC 20,789 bytes, 719 lines download raw bytes

1// NAVBAR SCROLLED //
2$(document).ready(function() {
3	if ($(window).scrollTop() > 80) {
4		$('.navbar').addClass('navbar-scrolled');
5	} else {
6		$('.navbar').removeClass('navbar-scrolled');
7	}
8});
9$(document).on('scroll', function () {
10	if ($(window).scrollTop() > 80) {
11		$('.navbar').addClass('navbar-scrolled');
12	} else {
13		$('.navbar').removeClass('navbar-scrolled');
14	}
15});
16
17
18
19// SEARCH HIDE MENU //
20
21$('#search-btn').click(function() {
22    $('#main-nav-links .nav-link').addClass('d-none');
23    setTimeout(function() {
24        $("#search-input").focus();
25		$('#searchbar').addClass('opacity-100');
26		$('#searchbar').removeClass('opacity-0');
27    });
28});
29
30$('#search-close').click(function() {
31	$('#main-nav-links .nav-link').removeClass('d-none');
32    setTimeout(function() {
33        $("#search-input").blur();
34		$('#searchbar').removeClass('opacity-100');
35		$('#searchbar').addClass('opacity-0');
36    });
37});
38
39
40// ANIMATE ON SCROLL //
41
42$(document).ready(function () {
43    AOS.init({
44        offset: 48,
45    });
46	window.addEventListener('load', AOS.refresh);
47});
48
49
50// POPOVERS //
51
52$(function () {
53	$('[data-toggle="popover"]').popover()
54});
55
56
57// TOOLTIPS //
58$(function () {
59	$('[data-toggle="tooltip"]').tooltip()
60});
61
62
63
64
65
66
67
68
69// DROPDOWN CLOSER //
70
71$(document).ready(function() {
72	$('.mega-dropdown-closer').click(function() {
73		$('.dropdown').removeClass('show');
74		$('.dropdown-menu').removeClass('show');
75		$('.dropdown-toggle').attr("aria-expanded", "false");
76	});
77});
78
79
80// DROPDOWN MENU ON HOVER //
81const $dropdown = $(".dropdown");
82const $dropdownToggle = $(".dropdown-toggle");
83const $dropdownMenu = $(".dropdown-menu");
84const showClass = "show";
85
86$(window).on("load resize", function() {
87  if (this.matchMedia("(min-width: 1199px)").matches) {
88    $dropdown.hover(
89      function() {
90        const $this = $(this);
91        $this.addClass(showClass);
92        $this.find($dropdownToggle).attr("aria-expanded", "true");
93        $this.find($dropdownMenu).addClass(showClass);
94        $this.find($dropdown).addClass(showClass);
95      },
96      function() {
97        const $this = $(this);
98        $this.removeClass(showClass);
99        $this.find($dropdownToggle).attr("aria-expanded", "false");
100        $this.find($dropdownMenu).removeClass(showClass);
101        $this.find($dropdown).removeClass(showClass);
102      }
103    );
104  } else {
105    $dropdown.off("mouseenter mouseleave");
106  }
107});
108
109
110// HERO PAUSE/PLAY //
111$('.hero-pp-btn').click(function() {
112    var ppIcon = $(this).find('.pp-icon');
113    if (ppIcon.hasClass('fa-pause')) {
114        $("#hero").carousel('pause');
115        $(ppIcon).removeClass('fa-pause');
116        $(ppIcon).addClass('fa-play');
117        $('.hero-pp-btn').attr('aria-label', 'Play');
118        $('.hero-pp-btn').attr('title', 'Play');
119        $('#hero .carousel-indicators li.active a').css('animation-play-state', 'paused');
120    }
121    else {
122        $("#hero").carousel('cycle');
123        $(ppIcon).addClass('fa-pause');
124        $(ppIcon).removeClass('fa-play');
125        $('.hero-pp-btn').attr('aria-label', 'Pause');
126		$('.hero-pp-btn').attr('title', 'Pause');
127        $('#hero .carousel-indicators li.active a').css('animation-play-state', 'running');
128    }
129});
130$('#hero .carousel-indicators li a').click(function() {
131    var ppIcon = $('.hero-pp-btn').find('.pp-icon');
132    if (ppIcon.hasClass('fa-play')) {
133		$("#hero").carousel('pause');
134        $('#hero .carousel-indicators li a').css('animation-play-state', 'paused');
135    }
136	else {
137		$("#hero").carousel('cycle');
138        $('#hero .carousel-indicators li a').css('animation-play-state', 'running');
139	}
140});
141
142var initialSlide = $('#hero .carousel-indicators').find('li.active a').attr('aria-current', 'true');
143
144$('#hero').on('slid.bs.carousel', function () {
145    var allSlides = $('#hero .carousel-indicators li a').removeAttr('aria-current');
146    var currentSlide = $('#hero .carousel-indicators').find('li.active a');
147    $(currentSlide).attr('aria-current', 'true');
148});
149
150
151// CAROUSEL INSIGHTS //
152$(document).ready(function () {
153	var swiper = new Swiper('.swiper-insights', {
154		slidesPerView: 1,
155	    slidesPerGroup: 1,
156	    spaceBetween: 15,
157	    watchOverflow: true,
158	    centerInsufficientSlides: true,
159	    breakpoints: {
160	    575: {
161	        slidesPerView: 1,
162	        slidesPerGroup: 1,
163	    },
164	    767: {
165	        slidesPerView: 2,
166	        slidesPerGroup: 2,
167	    },
168	    991: {
169	        slidesPerView: 3,
170	        slidesPerGroup: 3,
171	    },
172	    1199: {
173	        slidesPerView: 3,
174	        slidesPerGroup: 3,
175	        }
176	    },
177	    navigation: {
178	        nextEl: '.swiper-button-next',
179	        prevEl: '.swiper-button-prev',
180	    },
181		pagination: {
182			el: '.swiper-pagination',
183			clickable: true,
184        },
185	});
186});
187
188
189
190
191// FEATURED INVESTMENTS //
192$(document).ready(function () {
193	var swiper = new Swiper('.swiper-featured-investments', {
194	    slidesPerView: 1,
195	    slidesPerGroup: 1,
196	    spaceBetween: 15,
197		watchOverflow: true,
198	    centerInsufficientSlides: true,
199	    breakpoints: {
200	    576: {
201	        slidesPerView: 1,
202	        slidesPerGroup: 1,
203	    },
204	    768: {
205	        slidesPerView: 2,
206	        slidesPerGroup: 2,
207	    },
208	    992: {
209	        slidesPerView: 2,
210	        slidesPerGroup: 2,
211	    },
212	    1200: {
213	        slidesPerView: 3,
214	        slidesPerGroup: 3,
215            }
216        },
217	    navigation: {
218	        nextEl: '.swiper-button-next',
219	        prevEl: '.swiper-button-prev',
220	    },
221		pagination: {
222          el: '.swiper-pagination',
223          clickable: true,
224        },
225	});
226});
227
228
229// TEAM SWIPER //
230$(document).ready(function () {
231    var swiper = new Swiper('.swiper-team-management', {
232        slidesPerView: 2,
233        slidesPerGroup: 2,
234        spaceBetween: 15,
235        watchOverflow: true,
236        centerInsufficientSlides: true,
237        breakpoints: {
238            575: {
239                slidesPerView: 2,
240                slidesPerGroup: 2,
241            },
242            767: {
243                slidesPerView: 3,
244                slidesPerGroup: 3,
245            },
246            991: {
247                slidesPerView: 4,
248                slidesPerGroup: 4,
249            },
250            1199: {
251                slidesPerView: 5,
252                slidesPerGroup: 5,
253            }
254        },
255        navigation: {
256            nextEl: '.swiper-button-next',
257            prevEl: '.swiper-button-prev',
258        },
259        pagination: {
260            el: '.swiper-pagination',
261            clickable: true,
262        },
263    });
264});
265
266
267// RESEARCH PORTAL - SUBSCRIBE BELL ICON //
268$('.add-bell-btn a').click(function() {
269	$(this).tooltip('dispose');
270    var bellIcon = $(this).find('i');
271    if (bellIcon.hasClass('fa-light')) {
272        $(bellIcon).removeClass('fa-light');
273        $(bellIcon).addClass('fa-solid');
274        $(this).attr('data-original-title', 'Unsubscribe');
275		$(this).tooltip('show');
276    }
277    else {
278		$(bellIcon).addClass('fa-light');
279        $(bellIcon).removeClass('fa-solid');
280        $(this).attr('data-original-title', 'Subscribe');
281		$(this).tooltip('show');
282    }
283});
284
285$(document).ready(function () {
286	$('.research-card .add-bell-btn a').click(function() {
287		$(this).toggleClass('subscribed');
288	});
289});
290
291
292
293
294function custom_datatables(table_element) {
295    
296    var search_placeholder = $(table_element).data('search_placeholder');
297    var sorting = (typeof $(table_element).data('sorting') !== 'undefined') ? $(table_element).data('sorting') : true;
298
299    var no_sort = [];
300    var count = 0;
301    $(table_element).find('thead th').each(function() {
302        if ($(this).hasClass('no-sort')) no_sort.push(count);
303        count++;
304    })
305
306    var number_cells = $(table_element).find('tbody tr:first td').length;
307
308    var classification_column = 0;
309
310    var table = $(table_element).DataTable({
311		fixedHeader: {
312            header: true,
313			headerOffset: $('#main-navbar').outerHeight()
314        },
315		fixedColumns: {
316            left: 1
317        },
318		columnDefs: [
319			{ "orderable": false, "targets": no_sort },
320			{ "visible": false, "targets": classification_column },
321		],
322		scrollX: true,
323		scrollCollapse: true,
324		autoWidth: false,
325		paging: false,
326		pagingType: "numbers",
327		bPaginate: false,
328		bLengthChange: false,
329		bInfo: false,
330		bFilter: true,
331		bSort: sorting,
332		language: {
333			search: "_INPUT_",
334			searchPlaceholder: search_placeholder,
335			paginate: {
336      			previous: "Prev"
337    		}
338		},
339		order: [[ classification_column, 'asc' ]],
340        drawCallback: function (settings) {
341	        var api = this.api();
342	        var rows = api.rows( {page:'current'} ).nodes();
343	        var last=null;
344	        api.column(classification_column, {page:'current'} ).data().each( function ( group, i ) {
345	            if ( last !== group ) {
346	                $(rows).eq( i ).before(
347	                    '<tr class="group"><td colspan="'+number_cells+'"><span>'+group+'</span></td></tr>'
348	                );
349	                last = group;
350	            }
351	        });
352		},
353	});
354	$('.dataTables_wrapper .row .col-md-6').removeClass('col-md-6').addClass('px-0');
355	$('.dataTables_wrapper .form-control').removeClass('form-control-sm');
356
357    var filter_input_id = 'dt_filter_' + generate_id();
358
359    $(".dataTables_wrapper .dataTables_filter input").attr('aria-label', 'Search by ticker or fund name...').attr('id', filter_input_id).addClass('border-left-0 pl-0 custom-focus')
360    $(".dataTables_wrapper .dataTables_filter input").wrap('<div class="input-group"></div>');
361    $(".dataTables_wrapper .dataTables_filter input").parent('.input-group').prepend('<div class="input-group-prepend"><label for="' + filter_input_id +'" class="input-group-text"><i class="fa-light fa-search fa-fw"></i> <span class="sr-only">Search by ticker or fund name:</span></label></div>');
362
363    $('.dataTables_wrapper .dataTables_filter input').focus(function () {
364        $(this).parent('.input-group').addClass('input-focused');
365    });
366
367    $('.dataTables_wrapper .dataTables_filter input').blur(function () {
368        $(this).parent('.input-group').removeClass('input-focused');
369    });
370
371    $(".dataTables_wrapper").each(function() {
372
373        var widths = [];
374        $(this).find('.dataTables_scrollHeadInner th').each(function() {
375            widths.push($(this).outerWidth());
376        })
377
378    })
379
380    $(table_element).find('th').attr('aria-sort', 'none');
381}
382
383$(function() {
384    $('table').on('order.dt search.dt', function () {
385
386        var search_input = $('.dataTables_filter input');
387        var table_id = $(this).attr('id').replace('_filter', '');
388
389        var search_value = $(search_input).val();
390        if (search_value > "" && $("#" + table_id + " tbody tr td.dataTables_empty").length) {
391            $(search_input).attr('aria-live', 'assertive');
392        } else {
393            $(search_input).attr('aria-live', 'assertive');
394        }
395
396        
397    });
398})
399
400
401// ADD BUTTONS TO SCROLL TABLE HORIZONTALLY //
402// $(document).ready(function () {
403// 	$('.left-scroll').click(function() {
404// 		event.preventDefault();
405// 	  	$(this).parent().closest('.table-responsive').animate({
406//         	scrollLeft: "-=200px"
407//       	}, "slow");
408// 	});
409// 	$('.right-scroll').click(function() {
410// 		event.preventDefault();
411// 	  	$(this).parent().closest('.table-responsive').animate({
412//         	scrollLeft: "+=200px"
413//       	}, "slow");
414// 	});
415// });
416
417
418// VALIDATOR //
419$(document).ready(function() {
420	(function() {
421	  'use strict';
422	  window.addEventListener('load', function() {
423		// Fetch all the forms we want to apply custom Bootstrap validation styles to
424		var forms = document.getElementsByClassName('needs-validation');
425		// Loop over them and prevent submission
426		var validation = Array.prototype.filter.call(forms, function(form) {
427		  form.addEventListener('submit', function(event) {
428			if (form.checkValidity() === false) {
429			  event.preventDefault();
430			  event.stopPropagation();
431			}
432			form.classList.add('was-validated');
433		  }, false);
434		});
435	  }, false);
436	})();
437});
438
439
440// FORM REQUIRED ADD * FEATURE //
441$(function() {
442    $("form").each(function() {
443        $(this).find('[required]').each(function() {
444            $(this).addClass('has-required');
445            var label = $(this).parents('.form-group').find('label:first');
446            if ($(label).text().indexOf('*') == -1) $(label).append('*');
447        });
448    })
449});
450
451function reset_fields() {
452    $('.has-required:visible').attr('required', true);
453    $('.has-required:not(:visible)').removeAttr('required');
454}
455
456
457// FORMS //
458$(function() {
459	$('.selectpicker').selectpicker({
460	    dropupAuto: false,
461	});
462});
463
464
465// CAROUSEL SWIPE //
466!function(t){t.fn.bcSwipe=function(e){var n={threshold:50};return e&&t.extend(n,e),this.each(function(){function e(t){1==t.touches.length&&(u=t.touches[0].pageX,c=!0,this.addEventListener("touchmove",o,!1))}function o(e){if(c){var o=e.touches[0].pageX,i=u-o;Math.abs(i)>=n.threshold&&(h(),t(this).carousel(i>0?"next":"prev"))}}function h(){this.removeEventListener("touchmove",o),u=null,c=!1}var u,c=!1;"ontouchstart"in document.documentElement&&this.addEventListener("touchstart",e,!1)}),this}}(jQuery);
467
468$('.carousel').bcSwipe({ threshold: 50 });
469
470
471// page progress
472$(document).on('scroll', function() {
473    var pixels = $(document).scrollTop();
474    var pageHeight = $(document).height() - $(window).height();
475    var progress = 100 * pixels / pageHeight;
476    $("div.page-progress").css("width", progress + "%");
477    $("div.page-progress").attr("aria-valuemin", 0);
478    $("div.page-progress").attr("aria-valuemax", 100);
479    $("div.page-progress").attr("aria-valuenow", progress);
480});
481
482// work in progress to possibly merge all the below code into a function
483function manage_stickies() {
484
485    // manage mobile stuff - we need remove some of them
486    if ($(window).width() < 768) {
487       $('#fund-sticky-bar').remove();
488    }
489
490    // manage display
491	if ($(window).scrollTop() > 300) {
492		$('#fund-sticky-bar, #article-sticky-bar').addClass('show');
493	} else {
494		$('#fund-sticky-bar, #article-sticky-bar').removeClass('show');
495	}
496
497    ;
498
499    // misc calls
500    $('#article-sticky-bar a').tooltip();
501
502    // calculate our sticky height
503    var sticky_height = 0;
504    var sub_nav_height = 0;
505
506    $(".calc-sticky").each(function() {
507        if ($(this).attr('id') == 'subpage-nav') sub_nav_height += $(this).height();
508        else sticky_height += $(this).height();
509    })
510
511    var full_sticky_height = sticky_height + sub_nav_height;
512
513    // display stickies that start off not showing
514    $(".hidden-at-top").each(function() {
515		if (!$(this).hasClass('show')) $(this).hide();
516		else $(this).show();
517	})
518
519    // set our offsets as needed
520    $("body").attr('data-offset', full_sticky_height);
521    $("#subpage-nav").css('top', sticky_height);
522
523    // set our active values on the sub nav if needed
524    if ($("#subpage-nav").length) {
525
526        var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight();
527        var top_of_screen = $(window).scrollTop();
528        var middle_of_screen = Math.round((top_of_screen + bottom_of_screen)/2);
529
530        var last_active_div = false;
531
532        $("#main-content div").each(function() {
533
534            var id = $(this).attr('id');
535            if (id && $('.section-scroll[href="#'+id+'"]').length) {
536
537                var top_of_element = $(this).offset().top - full_sticky_height - 10;
538                var bottom_of_element = $(this).offset().top + $(this).outerHeight();
539
540                if (top_of_screen >= top_of_element) {
541                    last_active_div = id;
542                }
543
544            }
545
546        })
547
548        if (last_active_div && !$('.section-scroll[href="#'+last_active_div+'"]').hasClass('active')) {
549            $(".section-scroll.active").removeClass('active').removeAttr('aria-current');
550            window.history.replaceState("", document.title, window.location.href.replace(location.hash, "") + '#' + last_active_div);
551            $('.section-scroll[href="#'+last_active_div+'"]').addClass('active').attr('aria-current', 'location');
552        }
553    }
554
555    return full_sticky_height;
556
557}
558
559// ANCHOR SCROLL FUNCTION //
560$(window).on('load', function() {
561	var divHeader = ($('header.sticky-top').length) ? $('header.sticky-top').outerHeight() : 0;
562 	$('.smooth-scroll').click(function() {
563   		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
564	 		var target = $(this.hash);
565	 		target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
566	 	if (target.length) {
567	   		$('html,body').animate({
568		 		scrollTop: target.offset().top - (divHeader - 1)
569	 		}, 500);
570	   		return false;
571	 		}
572   		}
573 	});
574});
575
576
577// HORIZONTAL NAV SCROLL CENTERING //
578$(document).ready(function() {
579
580    $('#subpage-nav .hscroll-menu li a').click(function() {
581        var left = $(this).offset().left;
582        var item_width = $(this).parent('li').width()/2;
583        var nav_width = $('.hscroll-menu').width();
584        var diff = left - nav_width/2;
585        $('.hscroll-menu').animate({scrollLeft:($('.hscroll-menu').scrollLeft()+diff+item_width)}, 500);
586    });
587});
588
589
590$(document).ready(function() {
591
592    // related window.location.hash code at bottom
593
594    $('.section-scroll').click(function(e) {
595
596        e.preventDefault();
597
598        var section_div = (typeof $(this).attr('href') == typeof undefined || $(this).attr('href') == false) ? $(this).attr('data-target') : $(this).attr('href');
599        var stickies_height = manage_stickies();
600
601        var top_offset = $(section_div).offset().top;
602        if (!$("#subpage-nav.navbar-scrolled").length) top_offset = top_offset + stickies_height;
603
604		$('html, body').animate({
605        	scrollTop: top_offset - (stickies_height)
606    	}, 500);
607
608
609
610	});
611
612});
613
614
615// SCROLL TOP //
616
617$(document).on('scroll', function() {
618	if ($(window).scrollTop() > 540) {
619		$('.scroll-top').addClass('show');
620	} else {
621		$('.scroll-top').removeClass('show');
622	}
623});
624
625$(document).ready(function () {
626    $('.scroll-top').click(function (event) {
627        event.preventDefault();
628
629        const header = $('h1').first();
630
631        // Ensure the <h1> is focusable
632        if (!header.attr('tabindex')) {
633            header.attr('tabindex', '-1');
634        }
635
636        // Smooth scroll to the <h1>
637        $('html, body').animate({
638            scrollTop: header.offset().top - 125
639        }, 1000, function () {
640            // Focus the <h1> after scrolling
641            header.focus();
642        });
643
644        return false;
645    });
646});
647
648// $(document).ready(function() {
649//     $('.scroll-top').click(function(event) {
650//         event.preventDefault();
651//     $('html, body').animate({scrollTop: 0}, 1000);
652//         return false;
653//     });
654// });
655
656function resize_table_captions() {
657    $(".table-responsive caption").each(function () {
658        var table_width = $(this).parents('.table-responsive').innerWidth();
659        $(this).find('div').css('width', (table_width - 46) + 'px');
660    });
661}
662
663
664$(window).on('load', function () {
665
666    var original_hash = window.location.hash;
667
668    $("body").animate({ opacity: 1 }).css('display', 'inherit');
669
670    custom_datatables('.custom-datatables');
671    $("table").attr('role', 'region').attr('tabindex', 0);
672
673    var stickies_height = manage_stickies();
674
675   
676
677    // MODAL ACCESSIBILITY //
678    $('.modal').on('shown.bs.modal', function () {
679        var focusable = $(this).find("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");
680        var firstFocusable = focusable[0];
681        firstFocusable.focus();
682    });
683
684    $('.modal').keydown(function (e) {
685        var focusable = $(this).find("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");
686        if (focusable.last().is(":focus") && !e.shiftKey && e.key == "Tab") {
687            e.preventDefault();
688            focusable.first().focus();
689        }
690        else
691            if (focusable.first().is(":focus") && e.shiftKey && e.key == "Tab") {
692                e.preventDefault();
693                focusable.last().focus();
694            }
695    });
696
697    $(".selectpicker").attr('aria-hidden', 'true');
698
699    //$("i:not([aria-hidden])").attr('aria-hidden', true);
700
701    $(".fa-file-pdf").parents('a').append(' <span class="sr-only">(PDF Document)</span>');;
702    $(".fa-arrow-up-right-from-square, .fa-external-link").parents('a').append(' <span class="sr-only">(Opens in new window)</span>');
703
704    resize_table_captions();
705
706    $("body").animate({ opacity: 1 }).css('display', 'inherit');
707
708     if (original_hash > "" && $('.section-scroll[href="' + original_hash + '"]').length) {
709        $('html, body').animate({
710            scrollTop: $(original_hash).offset().top - stickies_height
711        }, 900, 'swing');
712    }
713
714
715
716});
717
718$(window).resize(function () { manage_stickies();
718 resize_table_captions(); }); /* on window resize */
719$(window).scroll(function () { manage_stickies(); }); /* on window scroll */

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.