Change to let/const instead of var

This commit is contained in:
Junior 2026-11-22 13:06:12 -05:00
parent 5b4118f20d
commit 39678d34c1

View File

@ -1,4 +1,4 @@
var chart;
let chart;
$(document).ready(function() {
$("#tabs").tabs({ active: 0 });
@ -14,7 +14,7 @@ $(document).ready(function() {
$("#tab-tasks").on("click", function() { getTasks(); });
//$("#tabs").on("tabsactivate", function(event, ui) { console.log($("#tabs").tabs('option', 'active')); });
getTasks();
var chartOptions = {
let chartOptions = {
chart: {
type: 'bar',
height: 550
@ -74,7 +74,7 @@ function updateChart() {
function deleteTask() {
if ( $("#form_id").val() == "0" ) return;
var doDelete = confirm("Are you certain you wish to delete this task?\n\nIf so then click 'OK'.")
const doDelete = confirm("Are you certain you wish to delete this task?\n\nIf so then click 'OK'.")
if ( !doDelete ) return;
$.ajax({
url: 'ajax/task-delete.php',
@ -210,7 +210,7 @@ function getTasks() {
dataType: 'json',
success: function(data, stat, jqo) {
$("#form_showall").prop('checked', data.showalltasks);
var show = "";
let show = "";
data.tasks.forEach(function(task, index) {
show += "<div class='task' id='task_" + task.id + "'>";
show += "<div><span class='strongtext'>Title: </span>" + task.title_safe + "</div>";