You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
1.1 KiB
JavaScript
1 line
1.1 KiB
JavaScript
7 months ago
|
"use strict";var WPFormsBuilderUtils=window.WPFormsBuilderUtils||function(t){const a={selectPagesChoicesUtils:{setup:function(e,s,n,t,i){s.searchEnabled=!0,s.searchChoices=!i,s.renderChoiceLimit=-1,s.noChoicesText=wpforms_builder.no_pages_found,s.noResultsText=wpforms_builder.no_pages_found;const o=new Choices(e,s);return i&&(o.input.element.addEventListener("keyup",function(e){8!==e.which&&46!==e.which||0<e.target.value.length||a.selectPagesChoicesUtils.performSearch(o,n,"",t)}),o.passedElement.element.addEventListener("search",_.debounce(function(e){0!==o.input.element.value.length&&a.selectPagesChoicesUtils.performSearch(o,n,e.detail.value,t)},800))),o},performSearch:function(s,e,n,t){a.selectPagesChoicesUtils.displayLoading(s);const i=a.selectPagesChoicesUtils.ajaxSearchPages(e,n,t);i.done(function(e){s.setChoices(e.data,"value","label",!0)})},displayLoading:function(e){e.setChoices([{value:"",label:wpforms_builder.loading+"...",disabled:!0}],"value","label",!0)},ajaxSearchPages:function(e,s,n){return t.get(wpforms_builder.ajax_url,{action:e,search:s,_wpnonce:n}).fail(function(e){console.error(e)})}}};return a}((document,window,jQuery));
|