diff --git a/public/javascripts/recent_changes.js b/public/javascripts/recent_changes.js index 246e10d60..05fe01273 100644 --- a/public/javascripts/recent_changes.js +++ b/public/javascripts/recent_changes.js @@ -1,86 +1,92 @@ -const recentChangesDialog = $("#recent-changes-dialog"); +const recentChanges = (function() { + const dialog = $("#recent-changes-dialog"); -async function showRecentChanges() { - recentChangesDialog.dialog({ - modal: true, - width: 800, - height: 700 - }); + async function showDialog() { + dialog.dialog({ + modal: true, + width: 800, + height: 700 + }); - const result = await $.ajax({ - url: baseApiUrl + 'recent-changes/', - type: 'GET', - error: () => error("Error getting recent changes.") - }); + const result = await $.ajax({ + url: baseApiUrl + 'recent-changes/', + type: 'GET', + error: () => error("Error getting recent changes.") + }); - recentChangesDialog.html(''); + dialog.html(''); - const groupedByDate = groupByDate(result); + const groupedByDate = groupByDate(result); - for (const [dateDay, dayChanges] of groupedByDate) { - const changesListEl = $('