You can not 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.8KB

  1. (self.webpackChunk=self.webpackChunk||[]).push([[146],{1245:(e,o,i)=>{"use strict";i(9826),i(4916),i(5306),i(1704);function n(e){e.data("allow-delete")&&(e.find(".field-collection-delete").off("click"),e.find(".field-collection-delete").on("click",(function(){$(this).parents(".form-group:first").remove(),l(e),0==t(e)&&e.find(".collection-empty").show()})))}function t(e){return e.data("reindex-key")?e.find(".field-collection-item").length:e.data("num-items")}function l(e){Tools.log("ncncnc"),e.data("reindex-key")&&(Tools.log("ncncnc"),e.find(".field-collection-item").each((function(e,o){$(o).find("input,textarea").each((function(o,i){var n=$(i),t=Tools.indexOfLastDigit(n.prop("id")),l=n.prop("id").substr(0,t),c=n.prop("id").substr(t+1);n.prop("id",l+e+c);var d=Tools.indexOfLastDigit(n.prop("name")),a=n.prop("name").substr(0,d),f=n.prop("name").substr(d+1);n.prop("name",a+e+f)}))})))}$(document).ready((function(){Tools.log("czefe"),$(".field-collection[data-prototype]").each((function(e,o){var i;(i=$(o)).data("sortable")&&(i.find(".field-collection-group").sortable({handle:".lc-btn-sortable",cancel:""}),i.find(".field-collection-group").on("sortupdate",(function(e,o){i.find(".field-collection-group>div").each((function(e,o){$(o).find(".field-position").val(e)}))}))),l($(o)),function(e){e.data("allow-add")&&e.find(".field-collection-add").on("click",(function(o){var i=e.attr("data-prototype");i=i.replace(/__name__/g,t(e)),e.find(".form-widget-compound .field-collection-group").append(i),e.find(".field-collection-item:last").find(".field-position").val(t(e)),l(e),n(e),e.trigger("collection-add-item"),e.data("num-items",e.data("num-items")+1),e.find(".collection-empty").hide()}))}($(o)),n($(o))}))}))}},e=>{"use strict";e.O(0,[381,855,2,968],(()=>{return o=1245,e(e.s=o);var o}));e.O()}]);