Add margin to clear button and fix case with new file in the cell [SCI-2403]

This commit is contained in:
Oleksii Kriuchykhin 2018-05-16 11:25:43 +02:00
parent be5d481cdc
commit c8094f196c
2 changed files with 11 additions and 5 deletions

View file

@ -961,11 +961,13 @@ var RepositoryDatatable = (function(global) {
}
function _addSelectedFile(type, cell, input) {
if (type === 'RepositoryAssetValue' && cell.value != null) {
const dT = new ClipboardEvent('').clipboardData || // Firefox workaround exploiting https://bugzilla.mozilla.org/show_bug.cgi?id=1422655
new DataTransfer(); // specs compliant (as of March 2018 only Chrome)
dT.items.add(new File([_], cell.value.file_file_name));
input.files = dT.files;
if (type === 'RepositoryAssetValue') {
if (cell.value != null) {
const dT = new ClipboardEvent('').clipboardData || // Firefox workaround exploiting https://bugzilla.mozilla.org/show_bug.cgi?id=1422655
new DataTransfer(); // specs compliant (as of March 2018 only Chrome)
dT.items.add(new File([_], cell.value.file_file_name));
input.files = dT.files;
}
$(input).on('change', function(){
this.dataset.changed = 'true';
});

View file

@ -33,4 +33,8 @@
.repository-input-file-field {
display: inline-flex;
.btn-danger {
margin-left: 5px;
}
}