mirror of
https://gh.wpcy.net/https://github.com/ztersinc/freescout-clickup-module.git
synced 2026-04-17 19:22:21 +08:00
25 lines
742 B
JavaScript
25 lines
742 B
JavaScript
/**
|
|
* Specific extension JS
|
|
*/
|
|
$(() => {
|
|
const $container = $('#extension-custom-field-copy-title-to-field-container')
|
|
|
|
if ($container.length) {
|
|
const $switch = $container.find('#--switch')
|
|
const $nameContainer = $container.find('#--name-container')
|
|
const $nameField = $nameContainer.find('#--name-field')
|
|
|
|
$switch.on('change', function() {
|
|
if ($(this).is(':checked')) {
|
|
$nameContainer.removeClass('hide')
|
|
$nameField.prop('required', true)
|
|
} else {
|
|
$nameContainer.addClass('hide')
|
|
$nameField.prop('required', false)
|
|
}
|
|
})
|
|
|
|
// Initial events
|
|
$switch.trigger('change')
|
|
}
|
|
});
|