mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 09:13:46 +08:00
Fix protocol templates rows selection flickering [SCI-8105] (#5185)
* Fix protocol templates rows selection flickering [SCI-8105] * Fix double initialization of row selection [SCI-8105]
This commit is contained in:
parent
7ef2f68078
commit
e065098082
2 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -219,7 +219,7 @@ class ProtocolsDatatable < CustomDatatable
|
|||
|
||||
def keywords_html(record)
|
||||
if record.protocol_keywords.blank?
|
||||
"<i>#{I18n.t('protocols.no_keywords')}</i>"
|
||||
I18n.t('protocols.no_keywords')
|
||||
else
|
||||
res = []
|
||||
record.protocol_keywords.sort_by { |kw| kw.name.downcase }.each do |kw|
|
||||
|
|
Loading…
Reference in a new issue