Revision e2982830
Added by Shlomi Zadok over 8 years ago
app/assets/javascripts/lookup_keys.js | ||
---|---|---|
// Setup
|
||
var assoc = $(item).attr('data-association'); // Name of child
|
||
var template_class = '.' + assoc + '_fields_template';
|
||
$(item).parent().find(template_class).find('select').select2('destroy');
|
||
var content = $(item).parent().find(template_class).html(); // Fields template
|
||
if (content == undefined) {content = $(template_class).html()};
|
||
|
||
... | ... | |
$(item).closest("form").trigger({type: 'nested:fieldAdded', field: field});
|
||
$('a[rel="popover"]').popover({html: true});
|
||
$('a[rel="twipsy"]').tooltip();
|
||
$(field).find('select:not(.matcher_key)').select2()
|
||
return new_id;
|
||
}
|
||
|
Also available in: Unified diff
fixes #11374 - re-initialize select2 on smart vars