-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Make massupdate compatible with v12 (#278)
- Loading branch information
1 parent
2749ab4
commit 5906436
Showing
6 changed files
with
94 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
/** | ||
* Module: TYPO3/CMS/Blog/MassUpdate | ||
*/ | ||
import $ from 'jquery'; | ||
|
||
var MassUpdate = { | ||
checkboxTriggerSelector: '.t3js-check-multiple-selection', | ||
checkboxSelector: '.t3js-check-multiple-selection input[type="checkbox"]', | ||
actionButton: '.t3js-check-multiple-action' | ||
const MassUpdate = { | ||
checkboxSelector: '.t3js-blog-massupdate-checkbox', | ||
actionButton: '.t3js-blog-massupdate-action' | ||
}; | ||
|
||
MassUpdate.initialize = function () { | ||
$(function () { | ||
$(document).on('click', MassUpdate.checkboxTriggerSelector, function() { | ||
MassUpdate.updateButton(); | ||
}); | ||
const checkboxes = document.querySelectorAll(MassUpdate.checkboxSelector); | ||
checkboxes.forEach((checkbox) => { | ||
checkbox.addEventListener('change', MassUpdate.updateButton); | ||
}); | ||
}; | ||
|
||
MassUpdate.updateButton = function() { | ||
var active = false; | ||
$(MassUpdate.checkboxSelector).each(function() { | ||
if ($(this).prop('checked')) { | ||
const checkboxes = document.querySelectorAll(MassUpdate.checkboxSelector); | ||
const buttons = document.querySelectorAll(MassUpdate.actionButton); | ||
|
||
let active = false; | ||
checkboxes.forEach((checkbox) => { | ||
if (checkbox.checked) { | ||
active = true; | ||
} | ||
}); | ||
$(MassUpdate.actionButton).prop('disabled', !active); | ||
buttons.forEach((button) => { | ||
button.disabled = !active; | ||
}); | ||
}; | ||
|
||
MassUpdate.initialize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,35 @@ | ||
.table.dataTable { | ||
margin-top: 0 !important; | ||
margin-bottom: 0 !important; | ||
|
||
.sorting { | ||
.form-select { | ||
min-width: 120px; | ||
} | ||
} | ||
|
||
tfoot th { | ||
border-bottom: none; | ||
} | ||
} | ||
|
||
.col-datatable-checkbox { | ||
width: 16px; | ||
min-width: 16px; | ||
box-sizing: content-box; | ||
padding-right: 0 !important; | ||
|
||
&:after, | ||
&:before { | ||
display: none !important; | ||
} | ||
} | ||
|
||
.col-datatable-actions { | ||
white-space: nowrap; | ||
width: 0; | ||
} | ||
|
||
.col-datatable-text { | ||
white-space: normal !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.