Skip to content

Commit

Permalink
kitodo#3747 improvements codacy review
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Oct 15, 2021
1 parent ad1c981 commit 2fef282
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Kitodo/src/main/webapp/WEB-INF/resources/js/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
* GPL3-License.txt file that was distributed with this source code.
*/

/*global PF*/
/*global PF, PrimeFaces*/
/*eslint new-cap: ["error", { "capIsNewExceptionPattern": "^PF" }]*/
/*eslint wrap-iife: ["error", "any"]*/

function registerRowToggleEvents(event) {
// add listener to expanded rows
Expand All @@ -34,7 +35,7 @@ function registerRowToggleEvents(event) {
PrimeFaces.widget.DataTable.prototype.updateData = (function () {
let cachedFunction = PrimeFaces.widget.DataTable.prototype.updateData;
return function () {
let reselectAll = (typeof this.selection !== undefined && this.selection[0] === '@all');
let reselectAll = (typeof this.selection !== "undefined" && this.selection[0] === '@all');
let result = cachedFunction.apply(this, arguments);
if (reselectAll) {
this.selectAllRows();
Expand All @@ -55,7 +56,7 @@ $(document).on("click", ".allSelectable .ui-chkbox-all .ui-chkbox-box", function
$(document).on("click", ".allSelectable .ui-chkbox .ui-chkbox-box", function () {
let tableId = $(this).closest(".allSelectable").attr('id').split(":").at(-1);
let table = new PF(tableId);
if (typeof table.selection !== undefined && table.selection[0] === '@all') {
if (typeof table.selection !== "undefined" && table.selection[0] === '@all') {
table.unselectAllRows();
}
});

0 comments on commit 2fef282

Please sign in to comment.