Fix repository text field rendering [SCI-5304] (#3015)

This commit is contained in:
aignatov-bio 2020-12-15 12:23:19 +01:00 committed by GitHub
parent 1025642afe
commit 329a5bff0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -13,11 +13,12 @@ $.fn.dataTable.render.editRowName = function(formId, cell) {
form="${formId}"
type="text"
name="repository_row[name]"
value="${text}"
value=""
placeholder="${I18n.t('repositories.table.enter_row_name')}"
data-type="RowName">
</div>
`);
$cell.find('input').val(text);
};
$.fn.dataTable.render.editRepositoryAssetValue = function(formId, columnId, cell) {
@ -34,11 +35,11 @@ $.fn.dataTable.render.editRepositoryTextValue = function(formId, columnId, cell)
form="${formId}"
type="text"
name="repository_cells[${columnId}]"
value="${text}"
value=""
placeholder="${I18n.t('repositories.table.text.enter_text')}"
data-type="RepositoryTextValue">
</div>`);
$cell.find('input').val(text);
SmartAnnotation.init($cell.find('input'));
};

View file

@ -26,7 +26,8 @@ $.fn.dataTable.render.defaultRepositoryAssetValue = function() {
};
$.fn.dataTable.render.RepositoryTextValue = function(data) {
var text = $(`<span class="text-value" data-edit-value="${data.value.edit}">${data.value.view}</span>`);
var text = $(`<span class="text-value">${data.value.view}</span>`);
text.attr('data-edit-value', data.value.edit);
return text.prop('outerHTML');
};