mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Fix repository text field rendering [SCI-5304] (#3015)
This commit is contained in:
parent
1025642afe
commit
329a5bff0b
2 changed files with 6 additions and 4 deletions
|
@ -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'));
|
||||
};
|
||||
|
||||
|
|
|
@ -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');
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue