4de9929f0e9f65c78664f40aa108b8f72d176c70
1 // http://civicrm.org/licensing
2 // JS needed for multilingual installations
4 // This is largely redundant with what the CRM.popup function would do,
5 // with the difference that this loads unconditionally regardless of ajaxPopupsEnabled setting
6 $('body').on('click', 'a.crm-multilingual-edit-button', function(e
) {
8 $form
= $el
.closest('form'),
9 $field
= $('#' + $el
.data('field'), $form
);
11 CRM
.loadForm($el
.attr('href'), {
12 dialog
: {width
: '50%', height
: '50%'}
14 .on('crmFormLoad', function() {
15 $('.default-lang', this).val($field
.val());
17 .on('crmFormSubmit', function() {
18 $field
.val($('.default-lang', this).val());
19 $el
.trigger('crmPopupFormSuccess');