From 29458375abf09a61bed6a14033b099bfdf6bcf5b Mon Sep 17 00:00:00 2001 From: Miha Mencin Date: Thu, 16 Jan 2020 13:39:49 +0100 Subject: [PATCH] SCI-4250 disable row selection when vieweng selected checklist items --- .../javascripts/repositories/repository_datatable.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/repositories/repository_datatable.js b/app/assets/javascripts/repositories/repository_datatable.js index 770210543..82dd296fa 100644 --- a/app/assets/javascripts/repositories/repository_datatable.js +++ b/app/assets/javascripts/repositories/repository_datatable.js @@ -106,6 +106,7 @@ var RepositoryDatatable = (function(global) { TABLE.button(0).enable(true); FilePreviewModal.init(); updateButtons(); + disableCheckboxToggleOnCheckboxPreview(); } function changeToEditMode() { @@ -373,6 +374,13 @@ var RepositoryDatatable = (function(global) { }); } + function disableCheckboxToggleOnCheckboxPreview(){ + $(".checklist-dropdown").click(function(e) { + e.stopPropagation(); + $(e.currentTarget).find("ul").toggle() + }); + } + // Adjust columns width in table header function adjustTableHeader() { TABLE.columns.adjust(); @@ -484,7 +492,6 @@ var RepositoryDatatable = (function(global) { FilePreviewModal.init(); // Prevent row toggling when selecting user smart annotation link SmartAnnotation.preventPropagation('.atwho-user-popover'); - // Show number of selected rows near pages info $('#repository-table_info').append(''); $('#selected_info').html(' (' + rowsSelected.length + ' entries selected)'); @@ -588,7 +595,7 @@ var RepositoryDatatable = (function(global) { }); TABLE.on('column-reorder', function() { - initRowSelection(); + FdSelection(); }); $('#assignRepositories, #unassignRepositories').click(function() {