silverstripe-userforms/client/dist/js/userforms-cms.js

1 line
2.9 KiB
JavaScript

!function(e){function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}var t={};i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},i.p="",i(i.s=2)}([function(e,i){window.jQuery.entwine("ss",function(e){var i=null;e(".uf-field-editor .ss-gridfield-items").entwine({onmatch:function(){var t=0,n=0,o=e(".uf-field-editor .ss-gridfield-buttonrow").addClass("sticky-buttons"),r=e(".cms-content-header.north").first().height()+parseInt(e(".sticky-buttons").css("padding-top"),10),s=e(".uf-field-editor");this._super(),this.find(".ss-gridfield-item").each(function(i,o){switch(e(o).data("class")){case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep":return void(n=0);case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup":t=++n;break;case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd":t=n--;break;default:t=n}for(e(o).toggleClass("infieldgroup",t>0),i=1;i<=5;i++)e(o).toggleClass("infieldgroup-level-"+i,t>=i)}),i=setInterval(function(){var e=s.offset().top;o.width("100%"),e>r||0===e?o.removeClass("sticky-buttons"):o.addClass("sticky-buttons")},300)},onunmatch:function(){this._super(),clearInterval(i)}}),e(".uf-field-editor .ss-gridfield-buttonrow .action").entwine({onclick:function(e){this._super(e),this.trigger("addnewinline")}}),e(".uf-field-editor").entwine({onmatch:function(){var i=this;this._super(),this.on("addnewinline",function(){i.one("reload",function(){var t=i.find(".ss-gridfield-item").last(),n=null;"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd"===t.attr("data-class")?(n=t,n.prev().find(".col-Title input").focus(),t=n.add(n.prev()),n.css("visibility","hidden")):t.find(".col-Title input").focus(),t.addClass("flashBackground"),e(".cms-content-fields").scrollTop(e(".cms-content-fields")[0].scrollHeight),n&&n.css("visibility","visible")})})},onummatch:function(){this._super()}})})},function(e,i,t){"use strict";var n=t(3),o=t.n(n),r=this;o.a.entwine("ss",function(){var e={updateFormatSpecificFields:function(){var e=o()('input[name="SendPlain"]').is(":checked");o()(".field.toggle-html-only")[e?"hide":"show"](),o()(".field.toggle-plain-only")[e?"show":"hide"]()}};o()("#Form_ItemEditForm .EmailRecipientForm").entwine({onmatch:function(){e.updateFormatSpecificFields()},onunmatch:function(){r._super()}}),o()('#Form_ItemEditForm .EmailRecipientForm input[name="SendPlain"]').entwine({onchange:function(){e.updateFormatSpecificFields()}})})},function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=t(0);t.n(n),t(1)},function(e,i){e.exports=jQuery}]);