Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created April 13, 2020 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/af4890cfeacb3ed40f068635041bfe14 to your computer and use it in GitHub Desktop.
Save Shelob9/af4890cfeacb3ed40f068635041bfe14 to your computer and use it in GitHub Desktop.
(function () {
jQuery(document).on("field.config-change", (e, update) => {
let { name, value } = update;
console.log(name, value);
});
jQuery(document).on("field.removed", (e, data) => {
const { fieldId } = data;
console.log(fieldId);
});
jQuery(document).on("field.added", (e, data) => {
const field = {
ID: data.field.id,
label: data.field.label,
slug: data.field.slug,
value: "",
type: "",
conditions: {
type: "",
},
config: {},
};
console.log(field);
});
jQuery(".caldera-editor-body").on(
"change",
".caldera-select-field-type",
function () {
const $this = jQuery(this);
let fieldId = $this.attr("data-field");
let type = $this.val();
console.log(fieldId, type);
}
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment