Файловый менеджер - Редактировать - /home/elecjxjk/tumaninvestigators.com/wp-content/plugins/wpforms-lite/assets/js/admin/builder/dropdown-list.min.js
Назад
var WPForms=window.WPForms||{};WPForms.Admin=WPForms.Admin||{},WPForms.Admin.Builder=WPForms.Admin.Builder||{},WPForms.Admin.Builder.DropdownList=WPForms.Admin.Builder.DropdownList||function(n){function o(t){const s=this,i={class:"",title:"",list:[],container:null,scrollableContainer:null,button:null,buttonDistance:10,onSelect:null,itemFormat(t){return t.text}};s.options=n.extend(i,t),s.$el=null,s.$builder=n("#wpforms-builder"),s.close=function(){s.$el.addClass("closed")},s.open=function(){s.$el.removeClass("closed"),s.setPosition(),s.$builder.on("click.DropdowmList",function(t){var t=n(t.target);t.closest(s.$el).length||t.hasClass("button-insert-field")||(s.$builder.off("click.DropdowmList"),(t=n(s.options.button)).hasClass("active")&&t.trigger("click"))})},s.generateHtml=function(){var t=s.options.list;if(!t||0===t.length)return"";var o=("function"==typeof s.options.itemFormat?s.options:i).itemFormat,n=[];for(const e in t)n.push(`<li data-value="${t[e].value}">${o(t[e])}</li>`);return`<div class="wpforms-builder-dropdown-list closed ${s.options.class}"> <div class="title">${s.options.title}</div> <ul>${n.join("")}</ul> </div>`},s.attach=function(){var t=s.generateHtml();s.$el&&s.$el.length&&s.$el.remove(),s.$el=n(t),s.$button=n(s.options.button),s.$container=s.options.container?n(s.options.container):s.$button.parent(),s.$scrollableContainer=s.options.scrollableContainer?n(s.options.scrollableContainer):null,s.$container.append(s.$el),s.setPosition()},s.setPosition=function(){var t=s.$button.offset(),o=s.$container.offset(),n=s.$container.position(),e=s.$el.height(),i=s.$scrollableContainer?s.$scrollableContainer.scrollTop():0;let l=t.top-o.top-e-s.options.buttonDistance;i+n.top-e<0&&(l=t.top-o.top+s.$button.height()+s.options.buttonDistance-11),s.$el.css("top",l),0===s.$container.closest(".wpforms-field-option").length&&s.$el.css("left",t.left-o.left)},s.events=function(){s.$el.find("li").off().on("click",function(t){var o;"function"==typeof s.options.onSelect&&(o=n(this),s.options.onSelect(t,o.data("value"),o.text(),o,s))})},s.init=function(t=null){s.options.list=t||s.options.list,s.attach(),s.events(),s.$button.data("dropdown-list",s)},s.destroy=function(){s.$button.data("dropdown-list",null),s.$el.remove()},s.init()}return{init(t){return new o(t)}}}((document,window,jQuery));
| ver. 1.4 |
Github
|
.
| PHP 8.1.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка