diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 5c9da133f..d02b6922d 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -52,4 +52,22 @@ document.addEventListener("turbolinks:load", function () { $('.masonry-grid').masonry({ percentPosition: true }); -}) \ No newline at end of file + + checkForNewsPopups(); +}) + +function checkForNewsPopups() { + $.ajax({ + url: Routes.news_popups_path(), + type: 'GET', + dataType: 'json', + success: (data) => { + console.log(data); + }, + error: (xhr, status) => { + console.log('ERROR fetching news popups'); + console.log(xhr); + console.log(status); + } + }) +} \ No newline at end of file