Created
April 13, 2020 22:14
-
-
Save Shelob9/af4890cfeacb3ed40f068635041bfe14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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