window.addEventListener("load", function () { jQuery("body").on( "click", ".wpm-6310-custom-field-mail-link-cls", function (event) { var customField = jQuery(this).attr("wpm-data-custom-field"); if (customField != undefined) { window.open(customField, "_blank").focus(); event.preventDefault(); var closest = jQuery(this).closest(".wpm_main_template"); if (Number(closest.attr("wpm-6310-google-tag"))) { if (!window.dataLayer) { window.dataLayer = window.dataLayer || []; } var text = jQuery(this) .closest(".wpm-6310-custom-field-mail-link-cls") .attr("wpm-data-custom-field"); var dataSet = { event: "click", eventAction: "Click", eventUrl: text, elementText: text, elementLabel: text, eventText: text, eventLabel: text, }; console.log("dataSet", dataSet); window.dataLayer.push(dataSet); } return false; } } ); var modalId = ""; jQuery("body").on( "click", ".wpm_6310_team_member_info, .wpm_6310_team_member_internal_link", function (event) { var linkActive = jQuery(this).attr("wpm-6310-link-active"); var closest = jQuery(this).closest(".wpm_main_template"); var memberInfo = jQuery(this).closest(".wpm_6310_team_member_info"); var memberSelector = jQuery(this).closest( ".wpm_6310_team_style_" + closest.attr("wpm-6310-carousel-id") ); if (typeof linkActive !== "undefined" && linkActive !== false) { return; } var allModal = jQuery(".wpm_6310_modal"); allModal.each(function () { jQuery(this).remove(); }); if (Number(closest.attr("wpm-6310-google-tag"))) { if (!window.dataLayer) { window.dataLayer = window.dataLayer || []; } var text = memberSelector.find('[class$="_title"]').text() + " - " + memberSelector.find('[class$="_designation"]').text(); var dataSet = { event: "click", eventAction: "Click", eventUrl: memberInfo.attr("link-url") || "modal open", elementText: text, elementLabel: text, eventText: text, eventLabel: text, }; console.log("dataSet", dataSet); window.dataLayer.push(dataSet); } modalId = parseInt(jQuery(this).attr("team-id")); var linkId = parseInt(jQuery(this).attr("link-id")); var linkUrl = jQuery(this).attr("data-wpm-link-url"); if (linkId > 0) { event.preventDefault(); if (jQuery(this).attr("target") == "1") { window.open(jQuery(this).attr("link-url"), "_blank").focus(); } else { window.open(jQuery(this).attr("link-url"), "_parent").focus(); } return false; } else if (linkUrl) { window.location.href = linkUrl; } else if (modalId > 0) { var mId = Number(closest.attr("wpm-6310-modal-template")); var tId = Number(closest.attr("wpm-6310-carousel-id")); var modal_02_custom_text = closest .find(".wpm-6310-modal-02-custom-text") .val(); var modal_03_custom_text = closest .find(".wpm-6310-modal-03-custom-text") .val(); var modal_03_custom_tooltip = closest .find(".wpm-6310-modal-03-custom-tooltip") .val(); var modal_05_custom_tooltip = closest .find(".wpm-6310-modal-05-custom-tooltip") .val(); if (modal_03_custom_tooltip) { modal_03_custom_tooltip = '
' + modal_03_custom_tooltip + "
"; } var html = '
×
'; if (mId == 2) { html += '
' + modal_02_custom_text + '
'; } else if (mId == 3) { html += '
' + modal_03_custom_tooltip + '
' + modal_03_custom_text + '
'; } else if (mId == 4) { html += '
'; } else if (mId == 5) { html += '
' + modal_05_custom_tooltip + '
'; } else if (mId == 6) { html += '
'; } else { html += '



'; } html += '

'; jQuery("body").prepend(html); jQuery( ".wpm_6310_loading_" + closest.attr("wpm-6310-carousel-id") ).show(); jQuery("body").css({ overflow: "hidden", }); var dataList = { action: "wpm_6310_team_member_details", ids: modalId, styleId: closest.attr("wpm-6310-carousel-id"), categoryStatus: closest.attr("wpm-6310-category-active"), selectedCategory: closest.attr("wpm-6310-selected-category"), clicked: "", progress_bar_animation: closest.attr( "wpm_6310_progress_bar_animation" ), progress_bar_border_radius: closest.attr( "wpm_6310_progress_bar_border_radius" ), }; wpm_6310_load_modal(dataList); } } ); jQuery("body").on("click", ".wpm_6310_modal_template_before", function () { var datas = { action: "wpm_6310_team_member_details", ids: jQuery(".wpm_6310_modal").attr("wpm-6310-member-id"), styleId: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm-6310-carousel-id"), categoryStatus: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm-6310-category-active"), selectedCategory: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm-6310-selected-category"), clicked: "prev", progress_bar_animation: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm_6310_progress_bar_animation"), progress_bar_border_radius: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm_6310_progress_bar_border_radius"), }; jQuery( ".wpm_6310_loading_" + jQuery(this).closest(".wpm_6310_modal").attr("wpm-6310-carousel-id") ).show(); jQuery(".wpm_6310_modal").hide(); wpm_6310_load_modal(datas); }); jQuery("body").on("click", ".wpm_6310_modal_template_after", function () { var datas = { action: "wpm_6310_team_member_details", ids: jQuery(".wpm_6310_modal").attr("wpm-6310-member-id"), styleId: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm-6310-carousel-id"), categoryStatus: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm-6310-category-active"), selectedCategory: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm-6310-selected-category"), clicked: "next", progress_bar_animation: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm_6310_progress_bar_animation"), progress_bar_border_radius: jQuery(this) .closest(".wpm_6310_modal") .attr("wpm_6310_progress_bar_border_radius"), }; jQuery( ".wpm_6310_loading_" + jQuery(this).closest(".wpm_6310_modal").attr("wpm-6310-carousel-id") ).show(); jQuery(".wpm_6310_modal").hide(); wpm_6310_load_modal(datas); }); }); function wpm_6310_load_modal(dataList) { jQuery.ajax({ type: "GET", dataType: "json", url: my_ajax_object.ajax_url, data: dataList, success: function (data) { jQuery(".wpm_6310_loading").hide(); jQuery(".wpm_6310_modal-content").css({ "animation-name": "wpm-animate" + data["styledata"]["effect"], }); jQuery(".wpm_6310_modal").show(); jQuery(".wpm_6310_modal").attr( "wpm-6310-member-id", data["styledata"]["id"] ); jQuery(".wpm_6310_modal").attr({ "wpm-6310-carousel-id": dataList["styleId"], "wpm-6310-category-active": dataList["categoryStatus"], "wpm-6310-selected-category": dataList["selectedCategory"], }); jQuery(".wpm_6310_modal").attr( "wpm_6310_progress_bar_animation", dataList["progress_bar_animation"] ); jQuery(".wpm_6310_modal").attr( "wpm_6310_progress_bar_border_radius", dataList["progress_bar_border_radius"] ); jQuery(".wpm_6310_modal_img").attr( "src", data["styledata"]["image"] ? data["styledata"]["image"] : data["styledata"]["hover_image"] ); jQuery(".wpm_6310_modal_hover_img").attr( "src", data["styledata"]["hover_image"] ? data["styledata"]["hover_image"] : data["styledata"]["image"] ); jQuery(".wpm_6310_modal_designation").text( data["styledata"]["designation"] ); jQuery(".wpm_6310_modal_name").text(data["styledata"]["name"]); jQuery(".wpm_6310_modal_category").text( data["styledata"]["categoryList"] ); jQuery(".wpm_6310_modal_contact").html(""); jQuery(".wpm_6310_modal_contact").append(data["contact"]); jQuery(".wpm_6310_modal_social").html(""); jQuery(".wpm_6310_modal_social").append(data["link"]); jQuery(".wpm_6310_modal_details").html( data["styledata"]["profile_details"] .replace(/\n/g, "
") .replace(/</g, "<") .replace(/>/g, ">") ); jQuery(".wpm_6310_member_skills_wrapper").html(""); jQuery(".wpm_6310_member_skills_wrapper").append(data["skills"]); }, }); }