$this->addMultimediaSizeFields();
$this->addField('header_tracks', FormSection::class, __('Pistes de sous-titres, descriptions et chapitres'));
- $this->addField('tracks', BunchOfFieldsMultiple::class, '', ['bunch' => VideoTrack::class, 'add_label' => __('Ajouter une piste'),'edit_label'=>'%kind : %label']);
+ $this->addField('tracks', BunchOfFieldsMultiple::class, '', ['bunch' => VideoTrack::class, 'add_label' => __('Ajouter une piste'), 'edit_label' => '%kind : %label', 'show_empty' => false]);
}
}
this.loadingFields = {};
this._maskChangeEvent = false;
this._maskChangeEventTimeout = null;
- this._saveFormDataAfterTextChangeTimeout=null;
+ this._saveFormDataAfterTextChangeTimeout = null;
this.init();
}
try {
$(this).select2('close');
$(this).select2('destroy');
- }catch (e){
+ } catch (e) {
}
});
this.initSpectrum();
$(".bunchmultiple").bunchmultiple();
+
if ($(link).is('.new')) {
this.focusAndSelectDestinationField();
}
if (map[k] !== undefined) {
k = map[k];
}
+ if (k.indexOf('bunchmultiple') === 0) {
+ return;
+ }
v = $this.normalizeFormValue(k, v);
+
if ($(form).find('[type="checkbox"][name=' + k + ']').length > 0) {
$(form).find('[type="checkbox"][name=' + k + ']').prop('checked', v === '1');
} else {
- $(form).find('[name=' + k + ']').val(v);
+ let f = $(form).find('[name=' + k + ']');
+ let bm = f.closest('.bunchmultiple');
+ if (bm.length > 0) {
+ bm.data('values', JSON.parse(v));
+ } else {
+ f.val(v);
+ }
}
if ($this.loadingFields[uid + '_' + k] === true) {