File: /var/www/ippmt.kauko.lt/wp-content/plugins/ocean-elementor-widgets/assets/js/query-post.min.js
!function(a){jQuery(window).on("elementor:init",function(){var b=elementor.modules.controls.BaseData.extend({isPostSearchReady:!1,getPostTitlesbyID:function(){var b=this,c=this.getControlValue();c&&(_.isArray(c)||(c=[c]),b.addControlSpinner(),a.ajax({url:ajaxurl,type:"POST",data:{action:"oew_get_posts_title_by_id",id:c},success:function(a){b.isPostSearchReady=!0,b.model.set("options",a),b.render()}}))},addControlSpinner:function(){this.ui.select.prop("disabled",!0),this.$el.find(".elementor-control-title").after('<span class="elementor-control-spinner"> <i class="fa fa-spinner fa-spin"></i> </span>')},onReady:function(){var a=this;this.ui.select.select2({placeholder:"Search",allowClear:!0,minimumInputLength:2,ajax:{url:ajaxurl,dataType:"json",method:"post",delay:250,data:function(b){return{q:b.term,post_type:a.model.get("post_type"),action:"oew_get_posts_by_query"}},processResults:function(a){return{results:a}},cache:!0}}),this.isPostSearchReady||this.getPostTitlesbyID()},onBeforeDestroy:function(){this.ui.select.data("select2")&&this.ui.select.select2("destroy"),this.$el.remove()}});elementor.addControlView("oew-query-posts",b)})}(jQuery);