← Back
Editing: editor.min.js
jQuery(document).ready((function(){function e(e,t){t.get("settings").set("ae_widget_id_hidden",t.attributes.id)}function t(e,t=!1){e.find("option").each((function(e,o){let i=jQuery(o).val();0==i.indexOf("option:")&&(i=i.replace("option:","")),t||-1==i.indexOf(":")?jQuery(o).show():jQuery(o).hide()}))}elementor.hooks.addAction("panel/open_editor/widget/ae-post-blocks-adv",e),elementor.hooks.addAction("panel/open_editor/widget/ae-post-blocks",e),elementor.hooks.addAction("panel/open_editor/widget/ae-acf-repeater",e),elementor.hooks.addAction("panel/open_editor/widget/ae-acf-gallery",e),elementor.hooks.addAction("panel/open_editor/widget/ae-acf-flexible-content",e),elementor.hooks.addAction("panel/open_editor/widget",(function(e,o,i){var n=o.attributes.widgetType;o.attributes.id;if("ae-acf-repeater"==n){jQuery(document).on("change","select[data-setting='layout_mode']",(function(){elementor.reloadPreview()}));let e=jQuery("select[data-setting='acf_repeater_field_name'] optgroup");"list"==jQuery("select[data-setting='_skin']").val()&&t(e),jQuery(document).on("change","select[data-setting='_skin']",(function(){"list"==jQuery(this).val()?t(e):t(e,!0)})),jQuery(document).on("focus","select[data-setting='acf_repeater_field_name']",(function(){"list"==jQuery("select[data-setting='_skin']").val()?t(e):t(e,!0)}))}if("ae-acf"==n&&jQuery(".elementor-control-_skin label").html("Field Type"),"ae-pods"==n&&jQuery(".elementor-control-_skin label").html("Field Type"),"ae-post-blocks-adv"==n){jQuery(".elementor-control-_skin label").html("Layout")}"ae-post-blocks"==n&&(jQuery(document).on("change","select[data-setting='layout_mode']",(function(){})),selected_post_ids=o.attributes.settings.attributes.ae_post_ids,jQuery.ajax({url:aepro.ajaxurl,dataType:"json",method:"post",data:{selected_posts:selected_post_ids,action:"ae_post_data",fetch_mode:"selected_posts",nonce:aepro.aep_nonce},success:function(e){options="",e.data.length&&jQuery.each(e.data,(function(e,t){options+='<option selected value="'+t.id+'">'+t.text+"</option>"})),jQuery("select[data-setting='ae_post_ids']").html(options).select2({ajax:{url:aepro.ajaxurl,dataType:"json",data:function(e){return{q:e.term,action:"ae_post_data",fetch_mode:"posts",nonce:aepro.aep_nonce}},processResults:function(e){return{results:e.data}}},minimumInputLength:2})}}))}))})),function(e,t,o){var i=e.modules.controls.Wysiwyg.extend({onReady:function(){}});e.addControlView("aep-raw-html",i);var n=e.modules.controls.Select2.extend({cache:null,isTitlesReceived:!1,getSelect2Placeholder:function(){return{id:"",text:this.model.get("placeholder")||"All"}},getSelect2DefaultOptions:function(){var t=this;return void 0!==t.model.get("parent_field")?parent_field=t.model.get("parent_field"):parent_field="flexible_field",jQuery.extend(e.modules.controls.Select2.prototype.getSelect2DefaultOptions.apply(this,arguments),{ajax:{transport:function(e,o,i){var n={q:e.data.q,query_type:t.model.get("query_type"),query_options:t.model.get("query_options"),object_type:t.model.get("object_type")};if("flex-sub-fields"===t.model.get("query_type")&&(void 0!==t.model.get("parent_field")?parent_field=t.model.get("parent_field"):parent_field="flexible_field",void 0!==t.container.settings.attributes[parent_field]&&(n.flex_parent_field=t.container.settings.attributes[parent_field]),void 0!==t.model.attributes.supported_fields&&(n.supported_field=t.model.attributes.supported_fields)),"group-sub-fields"===t.model.get("query_type")&&(void 0!==t.model.get("parent_field")?parent_field=t.model.get("parent_field"):parent_field="group_field",n.group_field=t.container.settings.attributes[parent_field],void 0!==t.model.get("supported_field")&&(supported_field=t.model.get("supported_field"),n.supported_field=t.model.attributes.supported_field)),"repeater-sub-fields"===t.model.get("query_type")&&(void 0!==t.model.get("parent_field")?parent_field=t.model.get("parent_field"):parent_field="repeater_field",n.repeater_parent_field=t.container.settings.attributes[parent_field],void 0!==t.model.get("is_repeater_control")&&t.model.get("is_repeater_control"))){var a=t.container.parent.parent.settings.attributes[parent_field];n.repeater_parent_field=a}return elementorCommon.ajax.addRequest("aep_query_autocomplete_data",{data:n,success:o,error:i})},data:function(e){return{q:e.term,page:e.page}},cache:!0},escapeMarkup:function(e){return e},minimumInputLength:1})},getValueTitles:function(){var e=this,t=this.getControlValue(),o=this.model.get("query_type"),i=this.model.get("query_options"),n=this.model.get("object_type");if(t&&o){if(_.isArray(t)||(t=[t]),"flex-sub-fields"===o)var a=e.container.settings.attributes[parent_field];if("group-sub-fields"===o)var r=e.container.settings.attributes[parent_field];if("repeater-sub-fields"===o)if(void 0!==e.model.get("is_repeater_control")&&e.model.get("is_repeater_control")){let t=e.model.get("parent_field");var l=e.container.parent.parent.settings.attributes[t]}else l=e.container.settings.attributes[parent_field];elementorCommon.ajax.loadObjects({action:"aep_query_value_titles",ids:t,data:{query_type:o,query_options:i,object_type:n,unique_id:""+e.cid+o,flex_parent_field:a,group_field:r,repeater_parent_field:l},success:function(t){e.isTitlesReceived=!0,e.model.set("options",t),e.render()},before:function(){e.addSpinner()}})}},addSpinner:function(){this.ui.select.prop("disabled",!0),this.$el.find(".elementor-control-title").after('<span class="elementor-control-spinner pp-control-spinner"> <i class="fa fa-spinner fa-spin"></i> </span>')},onReady:function(){var o=this;setTimeout(e.modules.controls.Select2.prototype.onReady.bind(this)),this.isTitlesReceived||this.getValueTitles(),t(document).on("click",".elementor-control-_repeater_sub_fields .elementor-repeater-fields .elementor-repeater-row-tools",(function(e){o.isTitlesReceived=!1,setTimeout((function(){o.isTitlesReceived||o.getValueTitles()}))}))},onBeforeDestroy:function(){this.ui.select.data("select2")&&this.ui.select.select2("destroy"),this.$el.remove()}});e.addControlView("aep-query",n)}(elementor,jQuery,window);
Save File
Cancel