From 2e041d9e81d6de473145c5e3ebea3ed97909b267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Zrim=C5=A1ek?= Date: Mon, 23 Jan 2017 10:53:47 +0100 Subject: [PATCH 1/2] Added smart annotations when adding new sample in samples table. [SCI-913] --- app/assets/javascripts/samples/sample_datatable.js.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index ca1d20927..be14fa143 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -678,6 +678,12 @@ function onClickAddSample() { $("select[name=sample_group_id]").selectpicker(); $("select[name=sample_type_id]").selectpicker(); + // initialize smart annotation + _.each($('[data-object="custom_fields"]'), function(el) { + if(_.isUndefined($(el).data('atwho'))) { + SmartAnnotation.init(el); + } + }); // Adjust columns width in table header table.columns.adjust(); }, From b48e48e100013b5a5c5c9cbf5ebb7599c662f7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Zrim=C5=A1ek?= Date: Tue, 24 Jan 2017 10:56:10 +0100 Subject: [PATCH 2/2] Prevent sample row in samples datatable from toggling when clicking on smart annotation link. [SCI-913] --- app/assets/javascripts/samples/sample_datatable.js.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index be14fa143..fc9847926 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -215,6 +215,8 @@ function dataTableInit() { // Handle table draw event table.on('draw', function() { updateDataTableSelectAllCtrl(table); + // Prevent sample row toggling when selecting user smart annotation link + SmartAnnotation.preventPropagation('.atwho-user-popover'); }); return table;