chg: [attribute:edit] Added support of chosen - fix #5736

pull/5767/head
mokaddem 2020-03-27 15:31:37 +01:00
parent 844ed9d1b8
commit c63d63b6ee
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 11 additions and 0 deletions

View File

@ -122,6 +122,7 @@
$('#AttributeCategory').change(function() { $('#AttributeCategory').change(function() {
formCategoryChanged('Attribute'); formCategoryChanged('Attribute');
$('#AttributeType').chosen('destroy').chosen();
if ($(this).val() === 'Internal reference') { if ($(this).val() === 'Internal reference') {
$("#AttributeDistribution").val('0'); $("#AttributeDistribution").val('0');
checkSharingGroup('Attribute'); checkSharingGroup('Attribute');
@ -166,6 +167,16 @@
} }
} }
}); });
<?php if (!$ajax): ?>
$('#AttributeType').chosen();
$('#AttributeCategory').chosen();
<?php else: ?>
setTimeout(function() { // make sure html is draw. TODO: use modal event to draw it
$('#AttributeType').chosen();
$('#AttributeCategory').chosen();
}, 500);
<?php endif; ?>
}); });
</script> </script>
<?php echo $this->element('form_seen_input'); ?> <?php echo $this->element('form_seen_input'); ?>