Support predefined values for "Add Storage" dialog forms (Bifrost#T55341)

This commit is contained in:
Aleksander Machniak 2017-11-09 11:29:48 +01:00
parent bb3b7fec0e
commit d5d0248a58

View file

@ -552,13 +552,21 @@ function kolab_files_folder_mount_dialog()
rcmail.drivers_list_initialized = true; rcmail.drivers_list_initialized = true;
$('td.source', dialog).each(function() { $('td.source', dialog).each(function() {
$(this).click(function() { var td = $(this),
id = td.attr('id').replace('source-', ''),
meta = rcmail.env.external_sources[id];
$.each(meta.form_values || [], function(i, v) {
td.find('#source-' + id + '-' + i).val(v);
});
td.click(function() {
$('td.selected', dialog).removeClass('selected'); $('td.selected', dialog).removeClass('selected');
dialog.find('.driverform').hide(); dialog.find('.driverform').hide();
$(this).addClass('selected').find('.driverform').show(); $(this).addClass('selected').find('.driverform').show();
$('input[type="radio"]', this).prop('checked', true); $('input[type="radio"]', this).prop('checked', true);
}); });
}); });
} }
args.button_classes = ['mainaction']; args.button_classes = ['mainaction'];