Fix smart annotation in inventory on edit

This commit is contained in:
aignatov-bio 2020-06-11 16:10:38 +02:00 committed by Urban Rotnik
parent 84aacecb81
commit 97f5a7e9fc
3 changed files with 7 additions and 5 deletions

View file

@ -27,7 +27,7 @@ $.fn.dataTable.render.editRepositoryAssetValue = function(formId, columnId, cell
$.fn.dataTable.render.editRepositoryTextValue = function(formId, columnId, cell) {
let $cell = $(cell.node());
let text = $cell.text();
let text = $cell.find('.text-value').data('edit-value');
$cell.html(`
<div class="sci-input-container text-field error-icon">

View file

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

View file

@ -8,9 +8,10 @@ module RepositoryDatatable
def value
@user = scope[:user]
custom_auto_link(object.data,
simple_format: true,
team: scope[:team])
{
view: custom_auto_link(object.data, simple_format: true, team: scope[:team]),
edit: sanitize_input(object.data)
}
end
end
end