blob: f3bde22b2ea94662a6e4f903a25867d9f2c3f7f3 (
plain)
1
|
!function(){var n;(n=window.jQuery)(document).on("change",".jp-contact-info-showmap",(function(){var t=n(this),e=t.is(":checked");t.closest(".widget").find(".jp-contact-info-admin-map").toggle(e)})),n(document).on("widget-synced",(function(t,e){if(e.is('[id*="widget_contact_info"]')&&n(document.activeElement).is('input[id*="apikey"]')){t.preventDefault();var i=e.find('input[id*="apikey"]');n.post(ajaxurl,{_ajax_nonce:contact_info_api_key_ajax_obj.nonce,action:"customize-contact-info-api-key",apikey:i.val()},(function(n){var t=i.closest(".jp-contact-info-admin-map").parent().find(".jp-contact-info-embed-map"),e=t.find('[class*="notice"]');"1"!==n.result?0===e.length?t.append('<span class="notice notice-warning" style="display: block;">'+n.result+"</span>"):e.text()!==n.result&&e.text(n.result):t.empty()}))}}))}();
|