mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-09 08:57:41 +08:00
Merge pull request #2394 from okriuchykhin/ok_SCI_4331
Fix DateTime picker for repositories edit mode [SCI-4331]
This commit is contained in:
commit
4b880de3b4
3 changed files with 23 additions and 23 deletions
|
@ -54,11 +54,11 @@ var DateTimeHelper = (function() {
|
|||
}
|
||||
|
||||
hiddenField = `
|
||||
<input class="repository-cell-value"
|
||||
type="hidden"
|
||||
form="${formId}"
|
||||
name="repository_cells[${columnId}]"
|
||||
value="${value}"
|
||||
<input class="repository-cell-value"
|
||||
type="hidden"
|
||||
form="${formId}"
|
||||
name="repository_cells[${columnId}]"
|
||||
value="${value}"
|
||||
data-type="${columnType}"/>`;
|
||||
|
||||
$container.find('input.repository-cell-value').remove();
|
||||
|
@ -89,11 +89,11 @@ var DateTimeHelper = (function() {
|
|||
}
|
||||
|
||||
hiddenField = `
|
||||
<input class="repository-cell-value"
|
||||
type="hidden"
|
||||
form="${formId}"
|
||||
name="repository_cells[${columnId}]"
|
||||
value='${value}'
|
||||
<input class="repository-cell-value"
|
||||
type="hidden"
|
||||
form="${formId}"
|
||||
name="repository_cells[${columnId}]"
|
||||
value='${value}'
|
||||
data-type="${columnType}"/>`;
|
||||
|
||||
$container.find('input.repository-cell-value').remove();
|
||||
|
@ -135,7 +135,7 @@ var DateTimeHelper = (function() {
|
|||
function dateInputField(value, dateDataValue) {
|
||||
return `
|
||||
<div class="sci-input-container date-container right-icon">
|
||||
<input class="calendar-input date-part sci-input-field"
|
||||
<input class="calendar-input date-part sci-input-field"
|
||||
type="datetime"
|
||||
placeholder="${formatJS}"
|
||||
data-datetime-part="date"
|
||||
|
@ -149,9 +149,9 @@ var DateTimeHelper = (function() {
|
|||
function timeInputField(value) {
|
||||
return `
|
||||
<div class="sci-input-container time-container right-icon">
|
||||
<input class="time-part sci-input-field"
|
||||
<input class="time-part sci-input-field"
|
||||
type="text"
|
||||
data-mask-type="time"
|
||||
data-mask-type="time"
|
||||
value='${value}'
|
||||
placeholder="HH:mm"/>
|
||||
<i class="fas fa-clock"></i>
|
||||
|
@ -200,7 +200,7 @@ var DateTimeHelper = (function() {
|
|||
let time = getTimeOrDefault($span, mode);
|
||||
let datetime = $span.data('datetime');
|
||||
let inputFields = `
|
||||
<div class="form-group datetime-container ${mode}"
|
||||
<div class="form-group datetime-container ${mode}"
|
||||
data-form-id="${formId}"
|
||||
data-column-id="${columnId}"
|
||||
data-type="${columnType}"
|
||||
|
@ -243,17 +243,17 @@ var DateTimeHelper = (function() {
|
|||
data-column-id="${columnId}"
|
||||
data-type="${columnType}"
|
||||
>
|
||||
<div class="start-time ${mode}"
|
||||
data-current-datetime="${startDatetime}">
|
||||
<div class="start-time ${mode}"
|
||||
data-current-datetime="${startDatetime}">
|
||||
${dateInputField(startDate, startDateDataValue)}
|
||||
${timeInputField(startTime)}
|
||||
${timeInputField(startTime)}
|
||||
</div>
|
||||
<div class="separator">—</div>
|
||||
<div class="end-time ${mode}"
|
||||
data-current-datetime="${endDatetime}">
|
||||
${dateInputField(endDate, endDateDataValue)}
|
||||
${timeInputField(endTime)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue