From 4547e4d61a657e065e01008ad275a8c743f241e8 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 7 Feb 2020 16:42:04 +0100 Subject: [PATCH] Fix DateTime picker for repositories edit mode [SCI-4331] --- .../renderers/columns/date_time_helper.js | 36 +++++++++---------- .../repositories/repository_datatable.js | 2 ++ .../repository/repository_table.scss | 8 ++--- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/assets/javascripts/repositories/renderers/columns/date_time_helper.js b/app/assets/javascripts/repositories/renderers/columns/date_time_helper.js index 5dffcc41d..17fc5dfc5 100644 --- a/app/assets/javascripts/repositories/renderers/columns/date_time_helper.js +++ b/app/assets/javascripts/repositories/renderers/columns/date_time_helper.js @@ -54,11 +54,11 @@ var DateTimeHelper = (function() { } hiddenField = ` - `; $container.find('input.repository-cell-value').remove(); @@ -89,11 +89,11 @@ var DateTimeHelper = (function() { } hiddenField = ` - `; $container.find('input.repository-cell-value').remove(); @@ -135,7 +135,7 @@ var DateTimeHelper = (function() { function dateInputField(value, dateDataValue) { return `
- - @@ -200,7 +200,7 @@ var DateTimeHelper = (function() { let time = getTimeOrDefault($span, mode); let datetime = $span.data('datetime'); let inputFields = ` -
-
+
${dateInputField(startDate, startDateDataValue)} - ${timeInputField(startTime)} + ${timeInputField(startTime)}
${dateInputField(endDate, endDateDataValue)} ${timeInputField(endTime)} -
+
`; diff --git a/app/assets/javascripts/repositories/repository_datatable.js b/app/assets/javascripts/repositories/repository_datatable.js index f9ae09fd5..f90ad3843 100644 --- a/app/assets/javascripts/repositories/repository_datatable.js +++ b/app/assets/javascripts/repositories/repository_datatable.js @@ -120,6 +120,7 @@ var RepositoryDatatable = (function(global) { // Table specific stuff TABLE.button(0).enable(true); FilePreviewModal.init(); + $(TABLE_WRAPPER_ID).find('tr').removeClass('blocked'); updateButtons(); disableCheckboxToggleOnCheckboxPreview(); } @@ -129,6 +130,7 @@ var RepositoryDatatable = (function(global) { // Table specific stuff TABLE.button(0).enable(false); clearRowSelection(); + $(TABLE_WRAPPER_ID).find('tr:not(.editing)').addClass('blocked'); updateButtons(); } diff --git a/app/assets/stylesheets/repository/repository_table.scss b/app/assets/stylesheets/repository/repository_table.scss index bce3a50d9..81bd95b1e 100644 --- a/app/assets/stylesheets/repository/repository_table.scss +++ b/app/assets/stylesheets/repository/repository_table.scss @@ -7,11 +7,9 @@ margin-top: 20px; &.editing { - tbody>tr { - &:not(.editing) { - opacity: .4; - pointer-events: none; - } + tbody>tr.blocked { + opacity: .4; + pointer-events: none; } }