diff --git a/src/assetbundles/src/js/OrderEntries.js b/src/assetbundles/src/js/OrderEntries.js index 009fe134..78d841c6 100644 --- a/src/assetbundles/src/js/OrderEntries.js +++ b/src/assetbundles/src/js/OrderEntries.js @@ -475,7 +475,7 @@ $label = (isDefaultTranslator ? 'Download ' : 'Sync ') + 'memory alignment files'; $downloadTmAction = $('', { - 'href': '#', + 'href': '#', 'class': isTmAligned ? 'link-disabled' : '', 'text': $label, }); @@ -536,47 +536,84 @@ }, _addDownloadTmFilesAction: function(that) { var self = this; - var action = isDefaultTranslator ? 'download' : 'sync'; + var action = isDefaultTranslator ? 'download' : 'sync'; $(that).on('click', function(e) { - e.preventDefault(); - self.toggleLoader(true); + e.preventDefault(); + + var $form = $('
', { + 'class': 'export-form' + }); - var files = []; - $rows = self.getFiles(true); - $rows.each(function() { - files.push($(this).data('file-id')); - }); + var $formatField = Craft.ui.createSelectField({ + label: Craft.t('app', 'Format'), + options: [ + {label: 'CSV', value: 'csv'}, {label: 'XML', value: 'xml'}, {label: 'JSON', value: 'json'}, + ], + 'class': 'fullwidth', + }).appendTo($form); + + let $typeSelect = $formatField.find('select'); + $typeSelect.on('change', () => { + $('', { + 'class': 'hidden', + 'name': 'format', + 'value': $typeSelect.val() + }).appendTo($form); + }); - $data = { - files: JSON.stringify(files), - orderId: $("input[type=hidden][name=id]").val() - } + $download = $('