Replaced the traditional function expressions with ES6 arrow function expressions in the JavaScript for the transaction order, account order, currency form, and the speed dial for the material floating action buttons.

This commit is contained in:
依瑪貓 2023-03-04 08:24:54 +08:00
parent a895bd8560
commit 641315537d
4 changed files with 7 additions and 7 deletions

View File

@ -22,10 +22,10 @@
*/ */
// Initializes the page JavaScript. // Initializes the page JavaScript.
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", () => {
const list = document.getElementById("accounting-order-list"); const list = document.getElementById("accounting-order-list");
if (list !== null) { if (list !== null) {
const onReorder = function () { const onReorder = () => {
const accounts = Array.from(list.children); const accounts = Array.from(list.children);
for (let i = 0; i < accounts.length; i++) { for (let i = 0; i < accounts.length; i++) {
const no = document.getElementById("accounting-order-" + accounts[i].dataset.id + "-no"); const no = document.getElementById("accounting-order-" + accounts[i].dataset.id + "-no");

View File

@ -22,7 +22,7 @@
*/ */
// Initializes the page JavaScript. // Initializes the page JavaScript.
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", () => {
document.getElementById("accounting-code") document.getElementById("accounting-code")
.onchange = validateCode; .onchange = validateCode;
document.getElementById("accounting-name") document.getElementById("accounting-name")

View File

@ -22,7 +22,7 @@
*/ */
// Initializes the page JavaScript. // Initializes the page JavaScript.
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", () => {
initializeMaterialFabSpeedDial(); initializeMaterialFabSpeedDial();
}); });
@ -34,7 +34,7 @@ document.addEventListener("DOMContentLoaded", function () {
function initializeMaterialFabSpeedDial() { function initializeMaterialFabSpeedDial() {
const btnFab = document.getElementById("accounting-btn-material-fab-speed-dial"); const btnFab = document.getElementById("accounting-btn-material-fab-speed-dial");
const fab = document.getElementById(btnFab.dataset.target); const fab = document.getElementById(btnFab.dataset.target);
btnFab.onclick = function () { btnFab.onclick = () => {
if (fab.classList.contains("show")) { if (fab.classList.contains("show")) {
fab.classList.remove("show"); fab.classList.remove("show");
} else { } else {

View File

@ -22,10 +22,10 @@
*/ */
// Initializes the page JavaScript. // Initializes the page JavaScript.
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", () => {
const list = document.getElementById("accounting-order-list"); const list = document.getElementById("accounting-order-list");
if (list !== null) { if (list !== null) {
const onReorder = function () { const onReorder = () => {
const accounts = Array.from(list.children); const accounts = Array.from(list.children);
for (let i = 0; i < accounts.length; i++) { for (let i = 0; i < accounts.length; i++) {
const no = document.getElementById("accounting-order-" + accounts[i].dataset.id + "-no"); const no = document.getElementById("accounting-order-" + accounts[i].dataset.id + "-no");