PageSourceSearch

https://cureheart.org/sites/all/modules/features/oxdrupal_listings/js/tile_rollover_height.js?tm7wi4

js cureheart.org collected 2026-10-04 03:55:15 UTC 3,038 bytes, 63 lines download raw bytes

1/**
2 * @file
3 * Calculates initial height of text box for item style tile with rollover text.
4 */
5
6jQuery(document).ready(function() {
7
8    jQuery(".listing-item-wrapper.item-style-tile_text_rollover article").mouseenter(function() {
9        jQuery(this).find(".text-box-wrapper").removeAttr("style");
10    });
11    jQuery(".listing-item-wrapper.item-style-tile_text_rollover article").mouseleave(function() {
12        oxdrupal_listings_calculate_tile_rollover_textbox_height(jQuery(this).find(".text-box-wrapper"));
13    });
14    jQuery(window).on('load', function() {
15        oxdrupal_listings_calculate_tile_rollover_textbox_heights();
16    });
17
18    window.addEventListener("orientationchange", function() {
19        oxdrupal_listings_calculate_tile_rollover_textbox_heights();
20    });
21    
22    window.addEventListener("resize", function() {
23        oxdrupal_listings_calculate_tile_rollover_textbox_heights();
24    });
25
26    //Fix heights for non-rollover items in IE11
27	var isIE11 = !!navigator.userAgent.match(/Trident.*rv\:11\./);
28	if(isIE11) {
29		jQuery(".slideshow-listing-wrapper .listing-item-wrapper.item-style-tile_text_displayed").parent().parent().parent().css({"display":"flex","flex":1});
30    }
31
32    document.addEventListener("react_listing_fetch", function(e) {
33        oxdrupal_listings_calculate_tile_rollover_textbox_heights();
34    });
35
36});
37
38var oxdrupal_listings_calculate_tile_rollover_textbox_heights = debounce(calculate_tile_rollover_textbox_heights, 100);
39
40function calculate_tile_rollover_textbox_heights() {
41  jQuery(".listing-item-wrapper.item-style-tile_text_rollover article .text-box-wrapper").each(function() {
42      oxdrupal_listings_calculate_tile_rollover_textbox_height(this);
43    });
44}
45
46function oxdrupal_listings_calculate_tile_rollover_textbox_height(textboxwrapper) {
47  var including_margin = true;
48  var title_height = jQuery(textboxwrapper).find(".text-box .listing-title").outerHeight(including_margin);
49  var text_box_padding_and_margin = jQuery(textboxwrapper).find(".text-box").outerHeight(including_margin) - jQuery(textboxwrapper).find(".text-box").height();
50	// Find date wrappers and combine into single number.
51	var date_height_pub = parseFloat(jQuery(textboxwrapper).find(".text-box .listing-item-pub-date").outerHeight(including_margin)) ?
52		jQuery(textboxwrapper).find(".text-box .listing-item-pub-date").outerHeight(including_margin) :
53		0;
54	var date_height_event = parseFloat(jQuery(textboxwrapper).find(".text-box .listing-item-event-date").outerHeight(including_margin)) ? 
55		jQuery(textboxwrapper).find(".text-box .listing-item-event-date").outerHeight(including_margin) :
56		0;
57	var date_height = date_height_pub + date_height_event;
58
59  var text_box_initial_height = (title_height + date_height + text_box_padding_and_margin);
60  jQuery(textboxwrapper).attr("style", "max-height:" + text_box_initial_height + "px");
61}
62
63function debounce(a,b,c){var d;return function(){var e = this,f = arguments;clearTimeout(d),d = setTimeout(function(){d = null,c||a.apply(e,f)},b),c&&!d&&a.apply(e,f)}}

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.