diff --git a/app/assets/javascripts/protocols/index.js b/app/assets/javascripts/protocols/index.js index 0004dd710..7b37c115b 100644 --- a/app/assets/javascripts/protocols/index.js +++ b/app/assets/javascripts/protocols/index.js @@ -239,7 +239,6 @@ var ProtocolsIndex = (function() { }, fnDrawCallback: function() { animateSpinner(this, false); - initRowSelection(); }, preDrawCallback: function() { animateSpinner(this); @@ -267,6 +266,7 @@ var ProtocolsIndex = (function() { initLocalFileImport(); initProtocolsFilters(); + initRowSelection(); }, stateLoadCallback: function() { // Load the table state for the current team @@ -309,8 +309,10 @@ var ProtocolsIndex = (function() { let protocolsTableScrollHead = protocolsTableEl.closest('.dataTables_scroll').find('.dataTables_scrollHead'); // Handle click on table cells with checkboxes - protocolsTableEl.on('click', 'tbody td, thead th:first-child', function() { - $(this).parent().find("input[type='checkbox']").trigger('click'); + protocolsTableEl.on('click', 'tbody td, thead th:first-child', function(ev) { + if (ev.target === ev.currentTarget) { + $(this).parent().find("input[type='checkbox']").trigger('click'); + } }); // Handle clicks on checkbox diff --git a/app/datatables/protocols_datatable.rb b/app/datatables/protocols_datatable.rb index ab784c756..de43e415c 100644 --- a/app/datatables/protocols_datatable.rb +++ b/app/datatables/protocols_datatable.rb @@ -219,7 +219,7 @@ class ProtocolsDatatable < CustomDatatable def keywords_html(record) if record.protocol_keywords.blank? - "#{I18n.t('protocols.no_keywords')}" + I18n.t('protocols.no_keywords') else res = [] record.protocol_keywords.sort_by { |kw| kw.name.downcase }.each do |kw|