summaryrefslogtreecommitdiff
blob: a9d25fcd018872d815cd7b2dfc3a95c565234eea (plain)
1
2
/* Do not modify this file directly. It is compiled from other files. */
!function(t){function i(i){i.find(".jetpack-social-icons-widget-list").sortable({items:"> .jetpack-social-icons-widget-item",handle:".handle",cursor:"move",placeholder:"jetpack-social-icons-widget-item ui-state-placeholder",containment:i,forcePlaceholderSize:!0,update:function(){e(t(this).parents(".form").find(".widget-control-save"))}})}function e(i){t(document.body).hasClass("wp-customizer")&&i.length&&i.trigger("click").hide()}var n=null;t(document).ready(function(){t(document).on("click",".jetpack-social-icons-widget.add-button button",function(i){i.preventDefault();var e,n,o,c,a,d;e=t(t.trim(t("#tmpl-jetpack-widget-social-icons-template").html())),n=t(this).parents(".widget-content"),o=n.find(".jetpack-social-icons-widget-list"),a=o.data("url-icon-id"),d=o.data("url-icon-name"),e.find(".jetpack-widget-social-icons-url input").attr("id",a).attr("name",d+"[]"),o.append(e),c=n.find(".jetpack-social-icons-widget-item:last"),c.find("input:first").trigger("focus")}),t(document).on("click",".jetpack-widget-social-icons-remove-item-button",function(i){i.preventDefault();var n=t(this).parents(".form").find(".widget-control-save");t(this).parents(".jetpack-social-icons-widget-item").remove(),e(n)}),t(document).on("click",'div.widget[id*="jetpack_widget_social_icons"] .widget-title, div.widget[id*="jetpack_widget_social_icons"] .widget-action',function(){t(this).parents("#available-widgets").length||i(t(this).parents('.widget[id*="jetpack_widget_social_icons"]'))}),t(document).on("widget-added",function(t,e){e.is('[id*="jetpack_widget_social_icons"]')&&(t.preventDefault(),i(e))}),t(document).on("widget-updated",function(t,e){e.is('[id*="jetpack_widget_social_icons"]')&&(t.preventDefault(),i(e))}),t(document).on("focusout",'input[name*="jetpack_widget_social_icons"]',function(){e(t(this).parents(".form").find(".widget-control-save"))}),t(document).on("keydown",'input[name*="jetpack_widget_social_icons"]',function(i){13===i.keyCode&&e(t(this).parents(".form").find(".widget-control-save"))}),t(document).on("keyup",'input[name*="jetpack_widget_social_icons"]',function(){clearTimeout(n),n=setTimeout(function(){e(t(this).parents(".form").find(".widget-control-save"))},1e3)}),t(document).on("change",'select[name*="jetpack_widget_social_icons"]',function(){e(t(this).parents(".form").find(".widget-control-save"))})})}(jQuery);