Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/js
File: custom.js
[4500] Fix | Delete
[4501] Fix | Delete
if (!$waypoint_selector.length) {
[4502] Fix | Delete
$waypoint_selector = et_get_first_module();
[4503] Fix | Delete
}
[4504] Fix | Delete
} else if (isFirstRowOnTop && window.et_is_transparent_nav && !window.et_is_vertical_nav && $et_main_content_first_row.length) {
[4505] Fix | Delete
$waypoint_selector = $('#content-area');
[4506] Fix | Delete
} else {
[4507] Fix | Delete
$waypoint_selector = $('#main-content');
[4508] Fix | Delete
} // Disabled section/row/module can cause waypoint to trigger 'down' event during its setup even if
[4509] Fix | Delete
// no scrolling happened, which would result in 'et-fixed-header' class being prematurely added.
[4510] Fix | Delete
// Since this only happens when page is loaded, we add an extra check that is no longer needed
[4511] Fix | Delete
// as soon as waypoint initialization is finished.
[4512] Fix | Delete
[4513] Fix | Delete
[4514] Fix | Delete
var checkIfScrolled = true;
[4515] Fix | Delete
setTimeout(function () {
[4516] Fix | Delete
checkIfScrolled = false;
[4517] Fix | Delete
}, 0);
[4518] Fix | Delete
$waypoint_selector.waypoint({
[4519] Fix | Delete
offset: function offset() {
[4520] Fix | Delete
if (etRecalculateOffset) {
[4521] Fix | Delete
setTimeout(function () {
[4522] Fix | Delete
et_calculate_header_values();
[4523] Fix | Delete
}, 200);
[4524] Fix | Delete
etRecalculateOffset = false;
[4525] Fix | Delete
}
[4526] Fix | Delete
[4527] Fix | Delete
if (et_hide_nav) {
[4528] Fix | Delete
return et_header_offset - et_header_height - 200;
[4529] Fix | Delete
} else {
[4530] Fix | Delete
// Transparent nav modification: #page-container's offset is set to 0. Modify et_header_offset's according to header height
[4531] Fix | Delete
var waypoint_selector_offset = $waypoint_selector.offset();
[4532] Fix | Delete
[4533] Fix | Delete
if (waypoint_selector_offset.top < et_header_offset) {
[4534] Fix | Delete
et_header_offset = 0 - (et_header_offset - waypoint_selector_offset.top);
[4535] Fix | Delete
}
[4536] Fix | Delete
[4537] Fix | Delete
return et_header_offset;
[4538] Fix | Delete
}
[4539] Fix | Delete
},
[4540] Fix | Delete
handler: function handler(direction) {
[4541] Fix | Delete
et_fix_logo_transition();
[4542] Fix | Delete
[4543] Fix | Delete
if (direction === 'down') {
[4544] Fix | Delete
if (checkIfScrolled && $et_window.scrollTop() === 0) {
[4545] Fix | Delete
return;
[4546] Fix | Delete
}
[4547] Fix | Delete
[4548] Fix | Delete
$main_header.addClass('et-fixed-header');
[4549] Fix | Delete
$main_container_wrapper.addClass('et-animated-content');
[4550] Fix | Delete
$top_header.addClass('et-fixed-header');
[4551] Fix | Delete
[4552] Fix | Delete
if (!et_hide_nav && !window.et_is_transparent_nav && !$('.mobile_menu_bar_toggle').is(':visible')) {
[4553] Fix | Delete
var secondary_nav_height = $top_header.length ? parseInt($top_header.height()) : 0,
[4554] Fix | Delete
$clone_header,
[4555] Fix | Delete
clone_header_height,
[4556] Fix | Delete
fix_padding;
[4557] Fix | Delete
$clone_header = $main_header.clone().addClass('et-fixed-header, et_header_clone').css({
[4558] Fix | Delete
'transition': 'none',
[4559] Fix | Delete
'display': 'none'
[4560] Fix | Delete
});
[4561] Fix | Delete
clone_header_height = parseInt($clone_header.prependTo('body').height()); // Vertical nav doesn't need #page-container margin-top adjustment
[4562] Fix | Delete
[4563] Fix | Delete
if (!window.et_is_vertical_nav) {
[4564] Fix | Delete
fix_padding = parseInt($main_container_wrapper.css('padding-top')) - clone_header_height - secondary_nav_height + 1;
[4565] Fix | Delete
$main_container_wrapper.css('margin-top', -fix_padding);
[4566] Fix | Delete
}
[4567] Fix | Delete
[4568] Fix | Delete
$('.et_header_clone').remove();
[4569] Fix | Delete
}
[4570] Fix | Delete
} else {
[4571] Fix | Delete
fix_padding = 1;
[4572] Fix | Delete
$main_header.removeClass('et-fixed-header');
[4573] Fix | Delete
$top_header.removeClass('et-fixed-header');
[4574] Fix | Delete
$main_container_wrapper.css('margin-top', -fix_padding);
[4575] Fix | Delete
} // Dispatch event when fixed header height transition starts
[4576] Fix | Delete
[4577] Fix | Delete
[4578] Fix | Delete
window.dispatchEvent(new CustomEvent('ETDiviFixedHeaderTransitionStart', {
[4579] Fix | Delete
detail: {
[4580] Fix | Delete
marginTop: -fix_padding
[4581] Fix | Delete
}
[4582] Fix | Delete
}));
[4583] Fix | Delete
setTimeout(function () {
[4584] Fix | Delete
et_set_search_form_css(); // Dispatch another event when fixed header height transition ends
[4585] Fix | Delete
[4586] Fix | Delete
window.dispatchEvent(new CustomEvent('ETDiviFixedHeaderTransitionEnd', {
[4587] Fix | Delete
detail: {
[4588] Fix | Delete
marginTop: -fix_padding
[4589] Fix | Delete
}
[4590] Fix | Delete
}));
[4591] Fix | Delete
}, 400);
[4592] Fix | Delete
}
[4593] Fix | Delete
});
[4594] Fix | Delete
}
[4595] Fix | Delete
[4596] Fix | Delete
if (et_hide_nav) {
[4597] Fix | Delete
et_hide_nav_transform();
[4598] Fix | Delete
}
[4599] Fix | Delete
}
[4600] Fix | Delete
}
[4601] Fix | Delete
[4602] Fix | Delete
$('a[href*="#"]:not([href="#"]), .mobile_nav').on('click', function (e) {
[4603] Fix | Delete
var $this_link = $(this),
[4604] Fix | Delete
has_closest_smooth_scroll_disabled = $this_link.closest('.et_smooth_scroll_disabled').length,
[4605] Fix | Delete
has_closest_woocommerce_tabs = $this_link.closest('.woocommerce-tabs').length && $this_link.closest('.tabs').length,
[4606] Fix | Delete
has_closest_timetable_tab = $this_link.closest('.tt_tabs_navigation').length,
[4607] Fix | Delete
has_closest_eab_cal_link = $this_link.closest('.eab-shortcode_calendar-navigation-link').length,
[4608] Fix | Delete
has_closest_ee_cart_link = $this_link.closest('.view-cart-lnk').length,
[4609] Fix | Delete
has_acomment_reply = $this_link.hasClass('acomment-reply'),
[4610] Fix | Delete
is_woocommerce_review_link = $this_link.hasClass('woocommerce-review-link'),
[4611] Fix | Delete
disable_scroll = has_closest_smooth_scroll_disabled || has_closest_ee_cart_link || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply || is_woocommerce_review_link || has_closest_timetable_tab;
[4612] Fix | Delete
[4613] Fix | Delete
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname && !disable_scroll) {
[4614] Fix | Delete
var target = $(this.hash); // Workaround for empty target in mobile menu.
[4615] Fix | Delete
[4616] Fix | Delete
if ($this_link.hasClass('mobile_nav')) {
[4617] Fix | Delete
target = $('#' + e.target.hash.slice(1));
[4618] Fix | Delete
}
[4619] Fix | Delete
[4620] Fix | Delete
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
[4621] Fix | Delete
[4622] Fix | Delete
if (target.length) {
[4623] Fix | Delete
// Workaround for reviews tab in woo tabs.
[4624] Fix | Delete
if ($(this).parents().hasClass('widget_recent_reviews')) {
[4625] Fix | Delete
$('.reviews_tab').click().animate({
[4626] Fix | Delete
scrollTop: target.offset().top
[4627] Fix | Delete
}, 700);
[4628] Fix | Delete
} // automatically close fullscreen menu if clicked from there
[4629] Fix | Delete
[4630] Fix | Delete
[4631] Fix | Delete
if ($this_link.closest('.et_pb_fullscreen_menu_opened').length > 0) {
[4632] Fix | Delete
et_pb_toggle_fullscreen_menu();
[4633] Fix | Delete
}
[4634] Fix | Delete
[4635] Fix | Delete
setTimeout(function () {
[4636] Fix | Delete
et_pb_smooth_scroll(target, false, 800);
[4637] Fix | Delete
}, 0);
[4638] Fix | Delete
[4639] Fix | Delete
if (!$('#main-header').hasClass('et-fixed-header') && $('body').hasClass('et_fixed_nav') && $(window).width() > 980) {
[4640] Fix | Delete
setTimeout(function () {
[4641] Fix | Delete
et_pb_smooth_scroll(target, false, 40, 'linear');
[4642] Fix | Delete
}, 780);
[4643] Fix | Delete
}
[4644] Fix | Delete
[4645] Fix | Delete
return false;
[4646] Fix | Delete
}
[4647] Fix | Delete
}
[4648] Fix | Delete
}); // Marking elements which has attached event already
[4649] Fix | Delete
[4650] Fix | Delete
$('a[href*="#"]:not([href="#"])').each(function (index, element) {
[4651] Fix | Delete
$(element).attr('data-et-has-event-already', 'true');
[4652] Fix | Delete
});
[4653] Fix | Delete
[4654] Fix | Delete
var et_pb_window_side_nav_get_sections = function et_pb_window_side_nav_get_sections() {
[4655] Fix | Delete
var $postRoot = $('.et-l--post');
[4656] Fix | Delete
var $inTBBody = $('.et-l--body .et_pb_section').not('.et-l--post .et_pb_section');
[4657] Fix | Delete
var $inPost;
[4658] Fix | Delete
[4659] Fix | Delete
if (builder_scripts_utils_utils__WEBPACK_IMPORTED_MODULE_0__["isBuilder"]) {
[4660] Fix | Delete
$inPost = $postRoot.find('.et-fb-post-content > .et_pb_section');
[4661] Fix | Delete
} else {
[4662] Fix | Delete
$inPost = $postRoot.find('.et_builder_inner_content > .et_pb_section');
[4663] Fix | Delete
}
[4664] Fix | Delete
[4665] Fix | Delete
if (0 === $inTBBody.length || $inPost.length > 1) {
[4666] Fix | Delete
return $inPost;
[4667] Fix | Delete
}
[4668] Fix | Delete
[4669] Fix | Delete
return $inTBBody;
[4670] Fix | Delete
};
[4671] Fix | Delete
[4672] Fix | Delete
window.et_pb_window_side_nav_scroll_init = function () {
[4673] Fix | Delete
if (true === window.et_calculating_scroll_position || false === window.et_side_nav_links_initialized) {
[4674] Fix | Delete
return;
[4675] Fix | Delete
}
[4676] Fix | Delete
[4677] Fix | Delete
var $sections = et_pb_window_side_nav_get_sections();
[4678] Fix | Delete
window.et_calculating_scroll_position = true;
[4679] Fix | Delete
var is_tb_layout_used = $('.et-l--header').length || $('.et-l--body').length || !$('#main-header').length;
[4680] Fix | Delete
var add_offset_default = is_tb_layout_used ? 0 : -90;
[4681] Fix | Delete
var add_offset = $('body').hasClass('et_fixed_nav') ? 20 : add_offset_default;
[4682] Fix | Delete
var top_header_height = $('#top-header').length > 0 ? parseInt($('#top-header').height()) : 0;
[4683] Fix | Delete
var main_header_height = $('#main-header').length > 0 ? parseInt($('#main-header').height()) : 0;
[4684] Fix | Delete
var side_offset;
[4685] Fix | Delete
[4686] Fix | Delete
if ($('#wpadminbar').length > 0 && parseInt($(window).width()) > 600) {
[4687] Fix | Delete
add_offset += parseInt($('#wpadminbar').outerHeight());
[4688] Fix | Delete
}
[4689] Fix | Delete
[4690] Fix | Delete
if (window.et_is_vertical_nav) {
[4691] Fix | Delete
side_offset = top_header_height + add_offset + 60;
[4692] Fix | Delete
} else {
[4693] Fix | Delete
side_offset = top_header_height + main_header_height + add_offset;
[4694] Fix | Delete
}
[4695] Fix | Delete
[4696] Fix | Delete
var window_height = parseInt($(window).height());
[4697] Fix | Delete
var scroll_position = parseInt($(window).scrollTop());
[4698] Fix | Delete
var document_height = parseInt($(document).height());
[4699] Fix | Delete
var at_bottom_of_page = window_height + scroll_position === document_height;
[4700] Fix | Delete
var total_links = $('.side_nav_item a').length - 1;
[4701] Fix | Delete
[4702] Fix | Delete
for (var link = 0; link <= total_links; link++) {
[4703] Fix | Delete
var $target_section = $sections.eq(link);
[4704] Fix | Delete
var at_top_of_page = 'undefined' === typeof $target_section.offset();
[4705] Fix | Delete
var current_active = $('.side_nav_item a.active').parent().index();
[4706] Fix | Delete
var next_active = null;
[4707] Fix | Delete
var target_offset = false === at_top_of_page ? $target_section.offset().top - side_offset : 0;
[4708] Fix | Delete
[4709] Fix | Delete
if (at_top_of_page) {
[4710] Fix | Delete
next_active = 0;
[4711] Fix | Delete
} else if (at_bottom_of_page) {
[4712] Fix | Delete
next_active = total_links;
[4713] Fix | Delete
} else if (scroll_position >= target_offset) {
[4714] Fix | Delete
next_active = link;
[4715] Fix | Delete
}
[4716] Fix | Delete
[4717] Fix | Delete
if (null !== next_active && next_active !== current_active) {
[4718] Fix | Delete
$('.side_nav_item a').removeClass('active');
[4719] Fix | Delete
$('a#side_nav_item_id_' + next_active).addClass('active');
[4720] Fix | Delete
}
[4721] Fix | Delete
}
[4722] Fix | Delete
[4723] Fix | Delete
window.et_calculating_scroll_position = false;
[4724] Fix | Delete
};
[4725] Fix | Delete
[4726] Fix | Delete
window.et_pb_side_nav_page_init = function () {
[4727] Fix | Delete
var $sections = et_pb_window_side_nav_get_sections();
[4728] Fix | Delete
var total_sections = $sections.length;
[4729] Fix | Delete
var side_nav_offset = parseInt((total_sections * 20 + 40) / 2);
[4730] Fix | Delete
window.et_side_nav_links_initialized = false;
[4731] Fix | Delete
window.et_calculating_scroll_position = false;
[4732] Fix | Delete
[4733] Fix | Delete
if (total_sections > 1 && $('.et_pb_side_nav_page').length) {
[4734] Fix | Delete
$('#main-content').append('<ul class="et_pb_side_nav"></ul>');
[4735] Fix | Delete
$sections.each(function (index, element) {
[4736] Fix | Delete
var active_class = 0 === index ? 'active' : '';
[4737] Fix | Delete
$('.et_pb_side_nav').append('<li class="side_nav_item"><a href="#" id="side_nav_item_id_' + index + '" class= "' + active_class + '">' + index + '</a></li>');
[4738] Fix | Delete
[4739] Fix | Delete
if (total_sections - 1 === index) {
[4740] Fix | Delete
window.et_side_nav_links_initialized = true;
[4741] Fix | Delete
}
[4742] Fix | Delete
});
[4743] Fix | Delete
$('ul.et_pb_side_nav').css('marginTop', '-' + side_nav_offset + 'px');
[4744] Fix | Delete
$('.et_pb_side_nav').addClass('et-visible');
[4745] Fix | Delete
$('.et_pb_side_nav a').click(function () {
[4746] Fix | Delete
// We use the index position of the sections to locate them instead of custom classes so
[4747] Fix | Delete
// that we have the same implementation for the frontend website and the Visual Builder.
[4748] Fix | Delete
var index = parseInt($(this).text());
[4749] Fix | Delete
var $target = $sections.eq(index);
[4750] Fix | Delete
var top_section = $(this).text() == "0" && !$('.et-l--body').length;
[4751] Fix | Delete
et_pb_smooth_scroll($target, top_section, 800);
[4752] Fix | Delete
[4753] Fix | Delete
if (!$('#main-header').hasClass('et-fixed-header') && $('body').hasClass('et_fixed_nav') && parseInt($(window).width()) > 980) {
[4754] Fix | Delete
setTimeout(function () {
[4755] Fix | Delete
et_pb_smooth_scroll($target, top_section, 200);
[4756] Fix | Delete
}, 500);
[4757] Fix | Delete
}
[4758] Fix | Delete
[4759] Fix | Delete
return false;
[4760] Fix | Delete
});
[4761] Fix | Delete
$(window).on('scroll', et_pb_window_side_nav_scroll_init);
[4762] Fix | Delete
}
[4763] Fix | Delete
};
[4764] Fix | Delete
[4765] Fix | Delete
if ($('body').is('.et-fb, .et-bfb')) {
[4766] Fix | Delete
// Debounce slow function
[4767] Fix | Delete
window.et_pb_side_nav_page_init = et_debounce(window.et_pb_side_nav_page_init, 200);
[4768] Fix | Delete
}
[4769] Fix | Delete
[4770] Fix | Delete
et_pb_side_nav_page_init();
[4771] Fix | Delete
[4772] Fix | Delete
if ($('.et_pb_scroll_top').length) {
[4773] Fix | Delete
$(window).scroll(function () {
[4774] Fix | Delete
if ($(this).scrollTop() > 800) {
[4775] Fix | Delete
$('.et_pb_scroll_top').show().removeClass('et-hidden').addClass('et-visible');
[4776] Fix | Delete
} else {
[4777] Fix | Delete
$('.et_pb_scroll_top').removeClass('et-visible').addClass('et-hidden');
[4778] Fix | Delete
}
[4779] Fix | Delete
}); //Click event to scroll to top
[4780] Fix | Delete
[4781] Fix | Delete
$('.et_pb_scroll_top').click(function () {
[4782] Fix | Delete
$('html, body').animate({
[4783] Fix | Delete
scrollTop: 0
[4784] Fix | Delete
}, 800);
[4785] Fix | Delete
});
[4786] Fix | Delete
}
[4787] Fix | Delete
[4788] Fix | Delete
if ($('.comment-reply-link').length) {
[4789] Fix | Delete
$('.comment-reply-link').addClass('et_pb_button');
[4790] Fix | Delete
}
[4791] Fix | Delete
[4792] Fix | Delete
$('#et_top_search').click(function () {
[4793] Fix | Delete
var $search_container = $('.et_search_form_container');
[4794] Fix | Delete
[4795] Fix | Delete
if ($search_container.hasClass('et_pb_is_animating')) {
[4796] Fix | Delete
return;
[4797] Fix | Delete
}
[4798] Fix | Delete
[4799] Fix | Delete
$('.et_menu_container').removeClass('et_pb_menu_visible et_pb_no_animation').addClass('et_pb_menu_hidden');
[4800] Fix | Delete
$search_container.removeClass('et_pb_search_form_hidden et_pb_no_animation').addClass('et_pb_search_visible et_pb_is_animating');
[4801] Fix | Delete
setTimeout(function () {
[4802] Fix | Delete
$('.et_menu_container').addClass('et_pb_no_animation');
[4803] Fix | Delete
$search_container.addClass('et_pb_no_animation').removeClass('et_pb_is_animating');
[4804] Fix | Delete
}, 1000);
[4805] Fix | Delete
$search_container.find('input').focus();
[4806] Fix | Delete
et_set_search_form_css();
[4807] Fix | Delete
});
[4808] Fix | Delete
[4809] Fix | Delete
function et_hide_search() {
[4810] Fix | Delete
if ($('.et_search_form_container').hasClass('et_pb_is_animating')) {
[4811] Fix | Delete
return;
[4812] Fix | Delete
}
[4813] Fix | Delete
[4814] Fix | Delete
$('.et_menu_container').removeClass('et_pb_menu_hidden et_pb_no_animation').addClass('et_pb_menu_visible');
[4815] Fix | Delete
$('.et_search_form_container').removeClass('et_pb_search_visible et_pb_no_animation').addClass('et_pb_search_form_hidden et_pb_is_animating');
[4816] Fix | Delete
setTimeout(function () {
[4817] Fix | Delete
$('.et_menu_container').addClass('et_pb_no_animation');
[4818] Fix | Delete
$('.et_search_form_container').addClass('et_pb_no_animation').removeClass('et_pb_is_animating');
[4819] Fix | Delete
}, 1000);
[4820] Fix | Delete
}
[4821] Fix | Delete
[4822] Fix | Delete
function et_set_search_form_css() {
[4823] Fix | Delete
var $search_container = $('.et_search_form_container');
[4824] Fix | Delete
var $body = $('body');
[4825] Fix | Delete
[4826] Fix | Delete
if ($search_container.hasClass('et_pb_search_visible')) {
[4827] Fix | Delete
var header_height = $('#main-header').innerHeight(),
[4828] Fix | Delete
menu_width = $('#top-menu').width(),
[4829] Fix | Delete
font_size = $('#top-menu li a').css('font-size');
[4830] Fix | Delete
$search_container.css({
[4831] Fix | Delete
'height': header_height + 'px'
[4832] Fix | Delete
});
[4833] Fix | Delete
$search_container.find('input').css('font-size', font_size);
[4834] Fix | Delete
[4835] Fix | Delete
if (!$body.hasClass('et_header_style_left')) {
[4836] Fix | Delete
$search_container.css('max-width', menu_width + 60);
[4837] Fix | Delete
} else {
[4838] Fix | Delete
$search_container.find('form').css('max-width', menu_width + 60);
[4839] Fix | Delete
}
[4840] Fix | Delete
}
[4841] Fix | Delete
}
[4842] Fix | Delete
[4843] Fix | Delete
$('.et_close_search_field').click(function () {
[4844] Fix | Delete
et_hide_search();
[4845] Fix | Delete
});
[4846] Fix | Delete
$(document).mouseup(function (e) {
[4847] Fix | Delete
var $header = $('#main-header');
[4848] Fix | Delete
[4849] Fix | Delete
if ($('.et_menu_container').hasClass('et_pb_menu_hidden')) {
[4850] Fix | Delete
if (!$header.is(e.target) && $header.has(e.target).length === 0) {
[4851] Fix | Delete
et_hide_search();
[4852] Fix | Delete
}
[4853] Fix | Delete
}
[4854] Fix | Delete
}); // Detect actual logo dimension, used for tricky fixed navigation transition
[4855] Fix | Delete
[4856] Fix | Delete
function et_define_logo_dimension() {
[4857] Fix | Delete
var $logo = $('#logo'),
[4858] Fix | Delete
logo_src = $logo.attr('src'),
[4859] Fix | Delete
is_svg = logo_src.substr(-3, 3) === 'svg' ? true : false,
[4860] Fix | Delete
$logo_wrap,
[4861] Fix | Delete
logo_width,
[4862] Fix | Delete
logo_height; // Append invisible wrapper at the bottom of the page
[4863] Fix | Delete
[4864] Fix | Delete
$('body').append($('<div />', {
[4865] Fix | Delete
'id': 'et-define-logo-wrap',
[4866] Fix | Delete
'style': 'position: fixed; bottom: 0; opacity: 0;'
[4867] Fix | Delete
})); // Define logo wrap
[4868] Fix | Delete
[4869] Fix | Delete
$logo_wrap = $('#et-define-logo-wrap');
[4870] Fix | Delete
[4871] Fix | Delete
if (is_svg) {
[4872] Fix | Delete
$logo_wrap.addClass('svg-logo');
[4873] Fix | Delete
} // Clone logo to invisible wrapper
[4874] Fix | Delete
[4875] Fix | Delete
[4876] Fix | Delete
$logo_wrap.html($logo.clone().css({
[4877] Fix | Delete
'display': 'block'
[4878] Fix | Delete
}).removeAttr('id')); // Get dimension
[4879] Fix | Delete
[4880] Fix | Delete
logo_width = $logo_wrap.find('img').width();
[4881] Fix | Delete
logo_height = $logo_wrap.find('img').height(); // Add data attribute to $logo
[4882] Fix | Delete
[4883] Fix | Delete
$logo.attr({
[4884] Fix | Delete
'data-actual-width': logo_width,
[4885] Fix | Delete
'data-actual-height': logo_height
[4886] Fix | Delete
}); // Destroy invisible wrapper
[4887] Fix | Delete
[4888] Fix | Delete
$logo_wrap.remove(); // Init logo transition onload
[4889] Fix | Delete
[4890] Fix | Delete
et_fix_logo_transition(true);
[4891] Fix | Delete
}
[4892] Fix | Delete
[4893] Fix | Delete
if ($('#logo').length) {
[4894] Fix | Delete
// Wait until logo is loaded before performing logo dimension fix
[4895] Fix | Delete
// This comes handy when the page is heavy due to the use of images or other assets
[4896] Fix | Delete
et_preload_image($('#logo').attr('src'), et_define_logo_dimension);
[4897] Fix | Delete
} // Set width for adsense in footer widget
[4898] Fix | Delete
[4899] Fix | Delete
[4900] Fix | Delete
$('.footer-widget').each(function () {
[4901] Fix | Delete
var $footer_widget = $(this),
[4902] Fix | Delete
footer_widget_width = $footer_widget.width(),
[4903] Fix | Delete
$adsense_ins = $footer_widget.find('.widget_adsensewidget ins');
[4904] Fix | Delete
[4905] Fix | Delete
if ($adsense_ins.length) {
[4906] Fix | Delete
$adsense_ins.width(footer_widget_width);
[4907] Fix | Delete
}
[4908] Fix | Delete
});
[4909] Fix | Delete
/**
[4910] Fix | Delete
* Visual Builder adjustment
[4911] Fix | Delete
*/
[4912] Fix | Delete
[4913] Fix | Delete
function et_fb_side_nav_page_init() {
[4914] Fix | Delete
$(window).off('scroll', window.et_pb_window_side_nav_scroll_init);
[4915] Fix | Delete
$('#main-content .et_pb_side_nav').off('click', '.et_pb_side_nav a');
[4916] Fix | Delete
$('#main-content .et_pb_side_nav').remove();
[4917] Fix | Delete
et_pb_side_nav_page_init();
[4918] Fix | Delete
}
[4919] Fix | Delete
[4920] Fix | Delete
if ($('body').is('.et-fb')) {
[4921] Fix | Delete
$(window).on('et_fb_root_did_mount', function () {
[4922] Fix | Delete
et_fb_side_nav_page_init();
[4923] Fix | Delete
et_all_elements_loaded();
[4924] Fix | Delete
});
[4925] Fix | Delete
$(window).on('et_fb_section_content_change', et_fb_side_nav_page_init);
[4926] Fix | Delete
} else {
[4927] Fix | Delete
window.addEventListener('load', et_all_elements_loaded);
[4928] Fix | Delete
}
[4929] Fix | Delete
}); // Fixing logo size transition in tricky header style
[4930] Fix | Delete
[4931] Fix | Delete
function et_fix_logo_transition(is_onload) {
[4932] Fix | Delete
var $body = $('body'),
[4933] Fix | Delete
$logo = $('#logo'),
[4934] Fix | Delete
logo_actual_width = parseInt($logo.attr('data-actual-width')),
[4935] Fix | Delete
logo_actual_height = parseInt($logo.attr('data-actual-height')),
[4936] Fix | Delete
logo_height_percentage = parseInt($logo.attr('data-height-percentage')),
[4937] Fix | Delete
$top_nav = $('#et-top-navigation'),
[4938] Fix | Delete
top_nav_height = parseInt($top_nav.attr('data-height')),
[4939] Fix | Delete
top_nav_fixed_height = parseInt($top_nav.attr('data-fixed-height')),
[4940] Fix | Delete
$main_header = $('#main-header'),
[4941] Fix | Delete
is_header_split = $body.hasClass('et_header_style_split'),
[4942] Fix | Delete
is_fixed_nav = $main_header.hasClass('et-fixed-header'),
[4943] Fix | Delete
is_hide_primary_logo = $body.hasClass('et_hide_primary_logo'),
[4944] Fix | Delete
is_hide_fixed_logo = $body.hasClass('et_hide_fixed_logo'),
[4945] Fix | Delete
logo_height_base = is_fixed_nav ? top_nav_height : top_nav_fixed_height,
[4946] Fix | Delete
logo_wrapper_width,
[4947] Fix | Delete
logo_wrapper_height;
[4948] Fix | Delete
is_onload = typeof is_onload === 'undefined' ? false : is_onload; // Fix for inline centered logo in horizontal nav
[4949] Fix | Delete
[4950] Fix | Delete
if (is_header_split && !window.et_is_vertical_nav) {
[4951] Fix | Delete
// On page load, logo_height_base should be top_nav_height
[4952] Fix | Delete
if (is_onload) {
[4953] Fix | Delete
logo_height_base = top_nav_height;
[4954] Fix | Delete
} // Calculate logo wrapper height
[4955] Fix | Delete
[4956] Fix | Delete
[4957] Fix | Delete
logo_wrapper_height = logo_height_base * (logo_height_percentage / 100) + 22; // Calculate logo wrapper width
[4958] Fix | Delete
[4959] Fix | Delete
logo_wrapper_width = logo_actual_width * (logo_wrapper_height / logo_actual_height); // Override logo wrapper width to 0 if it is hidden
[4960] Fix | Delete
[4961] Fix | Delete
if (is_hide_primary_logo && (is_fixed_nav || is_onload)) {
[4962] Fix | Delete
logo_wrapper_width = 0;
[4963] Fix | Delete
}
[4964] Fix | Delete
[4965] Fix | Delete
if (is_hide_fixed_logo && !is_fixed_nav && !is_onload) {
[4966] Fix | Delete
logo_wrapper_width = 0;
[4967] Fix | Delete
} // Set fixed width for logo wrapper to force correct dimension
[4968] Fix | Delete
[4969] Fix | Delete
[4970] Fix | Delete
$('.et_header_style_split .centered-inline-logo-wrap').css({
[4971] Fix | Delete
'width': logo_wrapper_width
[4972] Fix | Delete
});
[4973] Fix | Delete
}
[4974] Fix | Delete
}
[4975] Fix | Delete
[4976] Fix | Delete
function et_toggle_slide_menu(force_state) {
[4977] Fix | Delete
var $slide_menu_container = $('.et_header_style_slide .et_slide_in_menu_container'),
[4978] Fix | Delete
$page_container = $('.et_header_style_slide #page-container, .et_header_style_slide.et_fixed_nav #main-header'),
[4979] Fix | Delete
$header_container = $('.et_header_style_slide #main-header'),
[4980] Fix | Delete
is_menu_opened = $slide_menu_container.hasClass('et_pb_slide_menu_opened'),
[4981] Fix | Delete
set_to = typeof force_state !== 'undefined' ? force_state : 'auto',
[4982] Fix | Delete
is_boxed_layout = $('body').hasClass('et_boxed_layout'),
[4983] Fix | Delete
page_container_margin = is_boxed_layout ? parseFloat($('#page-container').css('margin-left')) : 0,
[4984] Fix | Delete
slide_container_width = $slide_menu_container.innerWidth(),
[4985] Fix | Delete
is_rtl = $('body').hasClass('rtl');
[4986] Fix | Delete
[4987] Fix | Delete
if ('auto' !== set_to && (is_menu_opened && 'open' === set_to || !is_menu_opened && 'close' === set_to)) {
[4988] Fix | Delete
return;
[4989] Fix | Delete
}
[4990] Fix | Delete
[4991] Fix | Delete
if (is_menu_opened) {
[4992] Fix | Delete
if (is_rtl) {
[4993] Fix | Delete
$slide_menu_container.css({
[4994] Fix | Delete
left: '-' + slide_container_width + 'px'
[4995] Fix | Delete
});
[4996] Fix | Delete
$page_container.css({
[4997] Fix | Delete
right: '0'
[4998] Fix | Delete
});
[4999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function