Fix declaration variable

This commit is contained in:
RubenPX 2022-05-09 11:29:48 +02:00
parent 4f72654f50
commit 8f80e7dff4
2 changed files with 25 additions and 15 deletions

View File

@ -1,6 +1,12 @@
"use strict"; "use strict";
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { _classCheckPrivateStaticAccess(receiver, classConstructor); _classCheckPrivateStaticFieldDescriptor(descriptor, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) { if (descriptor === undefined) { throw new TypeError("attempted to " + action + " private static field before its declaration"); } }
function _classCheckPrivateStaticAccess(receiver, classConstructor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } }
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
$(document).ready(() => { $(document).ready(() => {
const show_allocate_form = $("#allocateModal").data("show-action-form"); const show_allocate_form = $("#allocateModal").data("show-action-form");
@ -27,8 +33,8 @@ class TableController {
* @returns Selected inputs from device list * @returns Selected inputs from device list
*/ */
static getSelectedDevices() { static getSelectedDevices() {
if (this.tableRows() == undefined) return []; if (_classStaticPrivateFieldSpecGet(this, TableController, _tableRows).call(this) == undefined) return [];
return this.tableRows().filter(element => element.querySelector("input").checked).map(element => element.querySelector("input")); return _classStaticPrivateFieldSpecGet(this, TableController, _tableRows).call(this).filter(element => element.querySelector("input").checked).map(element => element.querySelector("input"));
} }
/** /**
* @returns Selected inputs in current page from device list * @returns Selected inputs in current page from device list
@ -36,8 +42,8 @@ class TableController {
static getAllSelectedDevicesInCurrentPage() { static getAllSelectedDevicesInCurrentPage() {
if (this.tableRowsPage() == undefined) return []; if (_classStaticPrivateFieldSpecGet(this, TableController, _tableRowsPage).call(this) == undefined) return [];
return this.tableRowsPage().filter(element => element.querySelector("input").checked).map(element => element.querySelector("input")); return _classStaticPrivateFieldSpecGet(this, TableController, _tableRowsPage).call(this).filter(element => element.querySelector("input").checked).map(element => element.querySelector("input"));
} }
/** /**
* @returns All inputs from device list * @returns All inputs from device list
@ -45,8 +51,8 @@ class TableController {
static getAllDevices() { static getAllDevices() {
if (this.tableRows() == undefined) return []; if (_classStaticPrivateFieldSpecGet(this, TableController, _tableRows).call(this) == undefined) return [];
return this.tableRows().map(element => element.querySelector("input")); return _classStaticPrivateFieldSpecGet(this, TableController, _tableRows).call(this).map(element => element.querySelector("input"));
} }
/** /**
* @returns All inputs from current page in device list * @returns All inputs from current page in device list
@ -54,8 +60,8 @@ class TableController {
static getAllDevicesInCurrentPage() { static getAllDevicesInCurrentPage() {
if (this.tableRowsPage() == undefined) return []; if (_classStaticPrivateFieldSpecGet(this, TableController, _tableRowsPage).call(this) == undefined) return [];
return this.tableRowsPage().map(element => element.querySelector("input")); return _classStaticPrivateFieldSpecGet(this, TableController, _tableRowsPage).call(this).map(element => element.querySelector("input"));
} }
/** /**
* *
@ -81,10 +87,14 @@ class TableController {
*/ */
_defineProperty(TableController, "tableRows", () => table.activeRows.length > 0 ? table.activeRows : []); var _tableRows = {
writable: true,
_defineProperty(TableController, "tableRowsPage", () => table.pages[table.rows().dt.currentPage - 1]); value: () => table.activeRows.length > 0 ? table.activeRows : []
};
var _tableRowsPage = {
writable: true,
value: () => table.pages[table.rows().dt.currentPage - 1]
};
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
const btnSelectAll = document.getElementById("SelectAllBTN"); const btnSelectAll = document.getElementById("SelectAllBTN");
const alertInfoDevices = document.getElementById("select-devices-info"); const alertInfoDevices = document.getElementById("select-devices-info");
@ -279,7 +289,7 @@ function get_device_list() {
; ;
return "".concat(typ, " ").concat(manuf, " ").concat(dhid); return "".concat(typ, " ").concat(manuf, " ").concat(dhid);
}); });
description = $.map(list_devices, x => x).join(", "); const description = $.map(list_devices, x => x).join(", ");
$(".enumeration-devices").html(description); $(".enumeration-devices").html(description);
} }

View File

@ -278,7 +278,7 @@ function get_device_list() {
return `${typ} ${manuf} ${dhid}`; return `${typ} ${manuf} ${dhid}`;
}); });
description = $.map(list_devices, (x) => x).join(", "); const description = $.map(list_devices, (x) => x).join(", ");
$(".enumeration-devices").html(description); $(".enumeration-devices").html(description);
} }