/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./src/advanced-custom-fields-pro/assets/src/js/_field-group-compatibility.js": /*!************************************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_field-group-compatibility.js ***! \************************************************************************************/ /***/ (function() { (function ($, undefined) { var _acf = acf.getCompatibility(acf); /** * fieldGroupCompatibility * * Compatibility layer for extinct acf.field_group * * @date 15/12/17 * @since 5.7.0 * * @param void * @return void */ _acf.field_group = { save_field: function ($field, type) { type = type !== undefined ? type : 'settings'; acf.getFieldObject($field).save(type); }, delete_field: function ($field, animate) { animate = animate !== undefined ? animate : true; acf.getFieldObject($field).delete({ animate: animate }); }, update_field_meta: function ($field, name, value) { acf.getFieldObject($field).prop(name, value); }, delete_field_meta: function ($field, name) { acf.getFieldObject($field).prop(name, null); } }; /** * fieldGroupCompatibility.field_object * * Compatibility layer for extinct acf.field_group.field_object * * @date 15/12/17 * @since 5.7.0 * * @param void * @return void */ _acf.field_group.field_object = acf.model.extend({ // vars type: '', o: {}, $field: null, $settings: null, tag: function (tag) { // vars var type = this.type; // explode, add 'field' and implode // - open => open_field // - change_type => change_field_type var tags = tag.split('_'); tags.splice(1, 0, 'field'); tag = tags.join('_'); // add type if (type) { tag += '/type=' + type; } // return return tag; }, selector: function () { // vars var selector = '.acf-field-object'; var type = this.type; // add type if (type) { selector += '-' + type; selector = acf.str_replace('_', '-', selector); } // return return selector; }, _add_action: function (name, callback) { // vars var model = this; // add action acf.add_action(this.tag(name), function ($field) { // focus model.set('$field', $field); // callback model[callback].apply(model, arguments); }); }, _add_filter: function (name, callback) { // vars var model = this; // add action acf.add_filter(this.tag(name), function ($field) { // focus model.set('$field', $field); // callback model[callback].apply(model, arguments); }); }, _add_event: function (name, callback) { // vars var model = this; var event = name.substr(0, name.indexOf(' ')); var selector = name.substr(name.indexOf(' ') + 1); var context = this.selector(); // add event $(document).on(event, context + ' ' + selector, function (e) { // append $el to event object e.$el = $(this); e.$field = e.$el.closest('.acf-field-object'); // focus model.set('$field', e.$field); // callback model[callback].apply(model, [e]); }); }, _set_$field: function () { // vars this.o = this.$field.data(); // els this.$settings = this.$field.find('> .settings > table > tbody'); // focus this.focus(); }, focus: function () {// do nothing }, setting: function (name) { return this.$settings.find('> .acf-field-setting-' + name); } }); /* * field * * This model fires actions and filters for registered fields * * @type function * @date 21/02/2014 * @since 3.5.1 * * @param n/a * @return n/a */ var actionManager = new acf.Model({ actions: { open_field_object: 'onOpenFieldObject', close_field_object: 'onCloseFieldObject', add_field_object: 'onAddFieldObject', duplicate_field_object: 'onDuplicateFieldObject', delete_field_object: 'onDeleteFieldObject', change_field_object_type: 'onChangeFieldObjectType', change_field_object_label: 'onChangeFieldObjectLabel', change_field_object_name: 'onChangeFieldObjectName', change_field_object_parent: 'onChangeFieldObjectParent', sortstop_field_object: 'onChangeFieldObjectParent' }, onOpenFieldObject: function (field) { acf.doAction('open_field', field.$el); acf.doAction('open_field/type=' + field.get('type'), field.$el); acf.doAction('render_field_settings', field.$el); acf.doAction('render_field_settings/type=' + field.get('type'), field.$el); }, onCloseFieldObject: function (field) { acf.doAction('close_field', field.$el); acf.doAction('close_field/type=' + field.get('type'), field.$el); }, onAddFieldObject: function (field) { acf.doAction('add_field', field.$el); acf.doAction('add_field/type=' + field.get('type'), field.$el); }, onDuplicateFieldObject: function (field) { acf.doAction('duplicate_field', field.$el); acf.doAction('duplicate_field/type=' + field.get('type'), field.$el); }, onDeleteFieldObject: function (field) { acf.doAction('delete_field', field.$el); acf.doAction('delete_field/type=' + field.get('type'), field.$el); }, onChangeFieldObjectType: function (field) { acf.doAction('change_field_type', field.$el); acf.doAction('change_field_type/type=' + field.get('type'), field.$el); acf.doAction('render_field_settings', field.$el); acf.doAction('render_field_settings/type=' + field.get('type'), field.$el); }, onChangeFieldObjectLabel: function (field) { acf.doAction('change_field_label', field.$el); acf.doAction('change_field_label/type=' + field.get('type'), field.$el); }, onChangeFieldObjectName: function (field) { acf.doAction('change_field_name', field.$el); acf.doAction('change_field_name/type=' + field.get('type'), field.$el); }, onChangeFieldObjectParent: function (field) { acf.doAction('update_field_parent', field.$el); } }); })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_field-group-conditions.js": /*!*********************************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_field-group-conditions.js ***! \*********************************************************************************/ /***/ (function() { (function ($, undefined) { /** * ConditionalLogicFieldSetting * * description * * @date 3/2/18 * @since 5.6.5 * * @param type $var Description. Default. * @return type Description. */ var ConditionalLogicFieldSetting = acf.FieldSetting.extend({ type: '', name: 'conditional_logic', events: { 'change .conditions-toggle': 'onChangeToggle', 'click .add-conditional-group': 'onClickAddGroup', 'focus .condition-rule-field': 'onFocusField', 'change .condition-rule-field': 'onChangeField', 'change .condition-rule-operator': 'onChangeOperator', 'click .add-conditional-rule': 'onClickAdd', 'click .remove-conditional-rule': 'onClickRemove' }, $rule: false, scope: function ($rule) { this.$rule = $rule; return this; }, ruleData: function (name, value) { return this.$rule.data.apply(this.$rule, arguments); }, $input: function (name) { return this.$rule.find('.condition-rule-' + name); }, $td: function (name) { return this.$rule.find('td.' + name); }, $toggle: function () { return this.$('.conditions-toggle'); }, $control: function () { return this.$('.rule-groups'); }, $groups: function () { return this.$('.rule-group'); }, $rules: function () { return this.$('.rule'); }, open: function () { var $div = this.$control(); $div.show(); acf.enable($div); }, close: function () { var $div = this.$control(); $div.hide(); acf.disable($div); }, render: function () { // show if (this.$toggle().prop('checked')) { this.renderRules(); this.open(); // hide } else { this.close(); } }, renderRules: function () { // vars var self = this; // loop this.$rules().each(function () { self.renderRule($(this)); }); }, renderRule: function ($rule) { this.scope($rule); this.renderField(); this.renderOperator(); this.renderValue(); }, renderField: function () { // vars var choices = []; var validFieldTypes = []; var cid = this.fieldObject.cid; var $select = this.$input('field'); // loop acf.getFieldObjects().map(function (fieldObject) { // vars var choice = { id: fieldObject.getKey(), text: fieldObject.getLabel() }; // bail early if is self if (fieldObject.cid === cid) { choice.text += acf.__('(this field)'); choice.disabled = true; } // get selected field conditions var conditionTypes = acf.getConditionTypes({ fieldType: fieldObject.getType() }); // bail early if no types if (!conditionTypes.length) { choice.disabled = true; } // calulate indents var indents = fieldObject.getParents().length; choice.text = '- '.repeat(indents) + choice.text; // append choices.push(choice); }); // allow for scenario where only one field exists if (!choices.length) { choices.push({ id: '', text: acf.__('No toggle fields available') }); } // render acf.renderSelect($select, choices); // set this.ruleData('field', $select.val()); }, renderOperator: function () { // bail early if no field selected if (!this.ruleData('field')) { return; } // vars var $select = this.$input('operator'); var val = $select.val(); var choices = []; // set saved value on first render // - this allows the 2nd render to correctly select an option if ($select.val() === null) { acf.renderSelect($select, [{ id: this.ruleData('operator'), text: '' }]); } // get selected field var $field = acf.findFieldObject(this.ruleData('field')); var field = acf.getFieldObject($field); // get selected field conditions var conditionTypes = acf.getConditionTypes({ fieldType: field.getType() }); // html conditionTypes.map(function (model) { choices.push({ id: model.prototype.operator, text: model.prototype.label }); }); // render acf.renderSelect($select, choices); // set this.ruleData('operator', $select.val()); }, renderValue: function () { // bail early if no field selected if (!this.ruleData('field') || !this.ruleData('operator')) { return; } // vars var $select = this.$input('value'); var $td = this.$td('value'); var val = $select.val(); // get selected field var $field = acf.findFieldObject(this.ruleData('field')); var field = acf.getFieldObject($field); // get selected field conditions var conditionTypes = acf.getConditionTypes({ fieldType: field.getType(), operator: this.ruleData('operator') }); // html var conditionType = conditionTypes[0].prototype; var choices = conditionType.choices(field); // create html: array if (choices instanceof Array) { var $newSelect = $(''); acf.renderSelect($newSelect, choices); // create html: string () } else { var $newSelect = $(choices); } // append $select.detach(); $td.html($newSelect); // copy attrs // timeout needed to avoid browser bug where "disabled" attribute is not applied setTimeout(function () { ['class', 'name', 'id'].map(function (attr) { $newSelect.attr(attr, $select.attr(attr)); }); }, 0); // select existing value (if not a disabled input) if (!$newSelect.prop('disabled')) { acf.val($newSelect, val, true); } // set this.ruleData('value', $newSelect.val()); }, onChangeToggle: function () { this.render(); }, onClickAddGroup: function (e, $el) { this.addGroup(); }, addGroup: function () { // vars var $group = this.$('.rule-group:last'); // duplicate var $group2 = acf.duplicate($group); // update h4 $group2.find('h4').text(acf.__('or')); // remove all tr's except the first one $group2.find('tr').not(':first').remove(); // save field this.fieldObject.save(); }, onFocusField: function (e, $el) { this.renderField(); }, onChangeField: function (e, $el) { // scope this.scope($el.closest('.rule')); // set data this.ruleData('field', $el.val()); // render this.renderOperator(); this.renderValue(); }, onChangeOperator: function (e, $el) { // scope this.scope($el.closest('.rule')); // set data this.ruleData('operator', $el.val()); // render this.renderValue(); }, onClickAdd: function (e, $el) { // duplciate var $rule = acf.duplicate($el.closest('.rule')); // render this.renderRule($rule); }, onClickRemove: function (e, $el) { // vars var $rule = $el.closest('.rule'); // save field this.fieldObject.save(); // remove group if ($rule.siblings('.rule').length == 0) { $rule.closest('.rule-group').remove(); } // remove $rule.remove(); } }); acf.registerFieldSetting(ConditionalLogicFieldSetting); /** * conditionalLogicHelper * * description * * @date 20/4/18 * @since 5.6.9 * * @param type $var Description. Default. * @return type Description. */ var conditionalLogicHelper = new acf.Model({ actions: { duplicate_field_objects: 'onDuplicateFieldObjects' }, onDuplicateFieldObjects: function (children, newField, prevField) { // vars var data = {}; var $selects = $(); // reference change in key children.map(function (child) { // store reference of changed key data[child.get('prevKey')] = child.get('key'); // append condition select $selects = $selects.add(child.$('.condition-rule-field')); }); // loop $selects.each(function () { // vars var $select = $(this); var val = $select.val(); // bail early if val is not a ref key if (!val || !data[val]) { return; } // modify selected option $select.find('option:selected').attr('value', data[val]); // set new val $select.val(data[val]); }); } }); })(jQuery); /***/ }), /***/ "./src/advanced-custom-fields-pro/assets/src/js/_field-group-field.js": /*!****************************************************************************!*\ !*** ./src/advanced-custom-fields-pro/assets/src/js/_field-group-field.js ***! \****************************************************************************/ /***/ (function() { (function ($, undefined) { acf.FieldObject = acf.Model.extend({ // class used to avoid nested event triggers eventScope: '.acf-field-object', // events events: { 'click .edit-field': 'onClickEdit', 'click .delete-field': 'onClickDelete', 'click .duplicate-field': 'duplicate', 'click .move-field': 'move', 'change .field-type': 'onChangeType', 'change .field-required': 'onChangeRequired', 'blur .field-label': 'onChangeLabel', 'blur .field-name': 'onChangeName', change: 'onChange', changed: 'onChanged' }, // data data: { // Similar to ID, but used for HTML puposes. // It is possbile for a new field to have an ID of 0, but an id of 'field_123' */ id: 0, // The field key ('field_123') key: '', // The field type (text, image, etc) type: '' // The $post->ID of this field //ID: 0, // The field's parent //parent: 0, // The menu order //menu_order: 0 }, setup: function ($field) { // set $el this.$el = $field; // inherit $field data (id, key, type) this.inherit($field); // load additional props // - this won't trigger 'changed' this.prop('ID'); this.prop('parent'); this.prop('menu_order'); }, $input: function (name) { return $('#' + this.getInputId() + '-' + name); }, $meta: function () { return this.$('.meta:first'); }, $handle: function () { return this.$('.handle:first'); }, $settings: function () { return this.$('.settings:first'); }, $setting: function (name) { return this.$('.acf-field-settings:first > .acf-field-setting-' + name); }, getParent: function () { return acf.getFieldObjects({ child: this.$el, limit: 1 }).pop(); }, getParents: function () { return acf.getFieldObjects({ child: this.$el }); }, getFields: function () { return acf.getFieldObjects({ parent: this.$el }); }, getInputName: function () { return 'acf_fields[' + this.get('id') + ']'; }, getInputId: function () { return 'acf_fields-' + this.get('id'); }, newInput: function (name, value) { // vars var inputId = this.getInputId(); var inputName = this.getInputName(); // append name if (name) { inputId += '-' + name; inputName += '[' + name + ']'; } // create input (avoid HTML + JSON value issues) var $input = $('').attr({ id: inputId, name: inputName, value: value }); this.$('> .meta').append($input); // return return $input; }, getProp: function (name) { // check data if (this.has(name)) { return this.get(name); } // get input value var $input = this.$input(name); var value = $input.length ? $input.val() : null; // set data silently (cache) this.set(name, value, true); // return return value; }, setProp: function (name, value) { // get input var $input = this.$input(name); var prevVal = $input.val(); // create if new if (!$input.length) { $input = this.newInput(name, value); } // remove if (value === null) { $input.remove(); // update } else { $input.val(value); } //console.log('setProp', name, value, this); // set data silently (cache) if (!this.has(name)) { //console.log('setting silently'); this.set(name, value, true); // set data allowing 'change' event to fire } else { //console.log('setting loudly!'); this.set(name, value); } // return return this; }, prop: function (name, value) { if (value !== undefined) { return this.setProp(name, value); } else { return this.getProp(name); } }, props: function (props) { Object.keys(props).map(function (key) { this.setProp(key, props[key]); }, this); }, getLabel: function () { // get label with empty default var label = this.prop('label'); if (label === '') { label = acf.__('(no label)'); } // return return label; }, getName: function () { return this.prop('name'); }, getType: function () { return this.prop('type'); }, getTypeLabel: function () { var type = this.prop('type'); var types = acf.get('fieldTypes'); return types[type] ? types[type].label : type; }, getKey: function () { return this.prop('key'); }, initialize: function () { this.addProFields(); }, addProFields: function () { // Make sure we're only running this on free version. if (acf.data.fieldTypes.hasOwnProperty('clone')) { return; } // Make sure we haven't appended these fields before. var $fieldTypeSelect = $('.field-type').not('.acf-free-field-type'); // Append pro fields to "Layout" group. var $layoutGroup = $fieldTypeSelect.find('optgroup option[value="group"]').parent(); $layoutGroup.append('' + '' + ''); // Add pro fields to "Content" group. var $contentGroup = $fieldTypeSelect.find('optgroup option[value="image"]').parent(); $contentGroup.append(''); $fieldTypeSelect.addClass('acf-free-field-type'); }, render: function () { // vars var $handle = this.$('.handle:first'); var menu_order = this.prop('menu_order'); var label = this.getLabel(); var name = this.prop('name'); var type = this.getTypeLabel(); var key = this.prop('key'); var required = this.$input('required').prop('checked'); // update menu order $handle.find('.acf-icon').html(parseInt(menu_order) + 1); // update required if (required) { label += ' *'; } // update label $handle.find('.li-field-label strong a').html(label); // update name $handle.find('.li-field-name').text(name); // update type $handle.find('.li-field-type').text(type); // update key $handle.find('.li-field-key').text(key); // action for 3rd party customization acf.doAction('render_field_object', this); }, refresh: function () { acf.doAction('refresh_field_object', this); }, isOpen: function () { return this.$el.hasClass('open'); }, onClickEdit: function (e) { this.isOpen() ? this.close() : this.open(); }, open: function () { // vars var $settings = this.$el.children('.settings'); // open $settings.slideDown(); this.$el.addClass('open'); // action (open) acf.doAction('open_field_object', this); this.trigger('openFieldObject'); // action (show) acf.doAction('show', $settings); }, close: function () { // vars var $settings = this.$el.children('.settings'); // close $settings.slideUp(); this.$el.removeClass('open'); // action (close) acf.doAction('close_field_object', this); this.trigger('closeFieldObject'); // action (hide) acf.doAction('hide', $settings); }, serialize: function () { return acf.serialize(this.$el, this.getInputName()); }, save: function (type) { // defaults type = type || 'settings'; // meta, settings // vars var save = this.getProp('save'); // bail if already saving settings if (save === 'settings') { return; } // prop this.setProp('save', type); // debug this.$el.attr('data-save', type); // action acf.doAction('save_field_object', this, type); }, submit: function () { // vars var inputName = this.getInputName(); var save = this.get('save'); // close if (this.isOpen()) { this.close(); } // allow all inputs to save if (save == 'settings') {// do nothing // allow only meta inputs to save } else if (save == 'meta') { this.$('> .settings [name^="' + inputName + '"]').remove(); // prevent all inputs from saving } else { this.$('[name^="' + inputName + '"]').remove(); } // action acf.doAction('submit_field_object', this); }, onChange: function (e, $el) { // save settings this.save(); // action for 3rd party customization acf.doAction('change_field_object', this); }, onChanged: function (e, $el, name, value) { // ignore 'save' if (name == 'save') { return; } // save meta if (['menu_order', 'parent'].indexOf(name) > -1) { this.save('meta'); // save field } else { this.save(); } // render if (['menu_order', 'label', 'required', 'name', 'type', 'key'].indexOf(name) > -1) { this.render(); } // action for 3rd party customization acf.doAction('change_field_object_' + name, this, value); }, onChangeLabel: function (e, $el) { // set var label = $el.val(); this.set('label', label); // render name if (this.prop('name') == '') { var name = acf.applyFilters('generate_field_object_name', acf.strSanitize(label), this); this.prop('name', name); } }, onChangeName: function (e, $el) { // set var name = $el.val(); this.set('name', name); // error if (name.substr(0, 6) === 'field_') { alert(acf.__('The string "field_" may not be used at the start of a field name')); } }, onChangeRequired: function (e, $el) { // set var required = $el.prop('checked') ? 1 : 0; this.set('required', required); }, delete: function (args) { // defaults args = acf.parseArgs(args, { animate: true }); // add to remove list var id = this.prop('ID'); if (id) { var $input = $('#_acf_delete_fields'); var newVal = $input.val() + '|' + id; $input.val(newVal); } // action acf.doAction('delete_field_object', this); // animate if (args.animate) { this.removeAnimate(); } else { this.remove(); } }, onClickDelete: function (e, $el) { // Bypass confirmation when holding down "shift" key. if (e.shiftKey) { return this.delete(); } // add class this.$el.addClass('-hover'); // add tooltip var tooltip = acf.newTooltip({ confirmRemove: true, target: $el, context: this, confirm: function () { this.delete(); }, cancel: function () { this.$el.removeClass('-hover'); } }); }, removeAnimate: function () { // vars var field = this; var $list = this.$el.parent(); var $fields = acf.findFieldObjects({ sibling: this.$el }); // remove acf.remove({ target: this.$el, endHeight: $fields.length ? 0 : 50, complete: function () { field.remove(); acf.doAction('removed_field_object', field, $list); } }); // action acf.doAction('remove_field_object', field, $list); }, duplicate: function () { // vars var newKey = acf.uniqid('field_'); // duplicate var $newField = acf.duplicate({ target: this.$el, search: this.get('id'), replace: newKey }); // set new key $newField.attr('data-key', newKey); // get instance var newField = acf.getFieldObject($newField); // open / close if (this.isOpen()) { this.close(); } else { newField.open(); } // focus label var $label = newField.$setting('label input'); setTimeout(function () { $label.trigger('focus'); }, 251); // update newField label / name var label = newField.prop('label'); var name = newField.prop('name'); var end = name.split('_').pop(); var copy = acf.__('copy'); // increase suffix "1" if (acf.isNumeric(end)) { var i = end * 1 + 1; label = label.replace(end, i); name = name.replace(end, i); // increase suffix "(copy1)" } else if (end.indexOf(copy) === 0) { var i = end.replace(copy, '') * 1; i = i ? i + 1 : 2; // replace label = label.replace(end, copy + i); name = name.replace(end, copy + i); // add default "(copy)" } else { label += ' (' + copy + ')'; name += '_' + copy; } newField.prop('ID', 0); newField.prop('label', label); newField.prop('name', name); newField.prop('key', newKey); // action acf.doAction('duplicate_field_object', this, newField); acf.doAction('append_field_object', newField); }, wipe: function () { // vars var prevId = this.get('id'); var prevKey = this.get('key'); var newKey = acf.uniqid('field_'); // rename acf.rename({ target: this.$el, search: prevId, replace: newKey }); // data this.set('id', newKey); this.set('prevId', prevId); this.set('prevKey', prevKey); // props this.prop('key', newKey); this.prop('ID', 0); // attr this.$el.attr('data-key', newKey); this.$el.attr('data-id', newKey); // action acf.doAction('wipe_field_object', this); }, move: function () { // helper var hasChanged = function (field) { return field.get('save') == 'settings'; }; // vars var changed = hasChanged(this); // has sub fields changed if (!changed) { acf.getFieldObjects({ parent: this.$el }).map(function (field) { changed = hasChanged(field) || field.changed; }); } // bail early if changed if (changed) { alert(acf.__('This field cannot be moved until its changes have been saved')); return; } // step 1. var id = this.prop('ID'); var field = this; var popup = false; var step1 = function () { // popup popup = acf.newPopup({ title: acf.__('Move Custom Field'), loading: true, width: '300px' }); // ajax var ajaxData = { action: 'acf/field_group/move_field', field_id: id }; // get HTML $.ajax({ url: acf.get('ajaxurl'), data: acf.prepareForAjax(ajaxData), type: 'post', dataType: 'html', success: step2 }); }; var step2 = function (html) { // update popup popup.loading(false); popup.content(html); // submit form popup.on('submit', 'form', step3); }; var step3 = function (e, $el) { // prevent e.preventDefault(); // disable acf.startButtonLoading(popup.$('.button')); // ajax var ajaxData = { action: 'acf/field_group/move_field', field_id: id, field_group_id: popup.$('select').val() }; // get HTML $.ajax({ url: acf.get('ajaxurl'), data: acf.prepareForAjax(ajaxData), type: 'post', dataType: 'html', success: step4 }); }; var step4 = function (html) { // update popup popup.content(html); // remove element field.removeAnimate(); }; // start step1(); }, onChangeType: function (e, $el) { // clea previous timout if (this.changeTimeout) { clearTimeout(this.changeTimeout); } // set new timeout // - prevents changing type multiple times whilst user types in newType this.changeTimeout = this.setTimeout(function () { this.changeType($el.val()); }, 300); }, changeType: function (newType) { // vars var prevType = this.prop('type'); var prevClass = acf.strSlugify('acf-field-object-' + prevType); var newClass = acf.strSlugify('acf-field-object-' + newType); // update props this.$el.removeClass(prevClass).addClass(newClass); this.$el.attr('data-type', newType); this.$el.data('type', newType); // abort XHR if this field is already loading AJAX data if (this.has('xhr')) { this.get('xhr').abort(); } // store settings var $tbody = this.$('> .settings > table > tbody'); var $settings = $tbody.children('[data-setting="' + prevType + '"]'); this.set('settings-' + prevType, $settings); $settings.detach(); // show settings if (this.has('settings-' + newType)) { var $newSettings = this.get('settings-' + newType); this.$setting('conditional_logic').before($newSettings); this.set('type', newType); //this.refresh(); return; } // load settings var $loading = $('