From c00d966fd7c54dbfae8f6ebd369ad13a678f1146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Marchal?= Date: Mon, 8 Aug 2022 12:28:33 +0200 Subject: [PATCH] Fix no fancybox configuration on reload fixes #18 --- explorer.html | 2 +- exposition.html | 1 + scripts/explorer.js | 7 ++----- scripts/exposition.js | 10 ++++------ 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/explorer.html b/explorer.html index 3803b8a..8b4541d 100644 --- a/explorer.html +++ b/explorer.html @@ -11,9 +11,9 @@ - + diff --git a/exposition.html b/exposition.html index aa536ed..7e4acce 100644 --- a/exposition.html +++ b/exposition.html @@ -14,6 +14,7 @@ + diff --git a/scripts/explorer.js b/scripts/explorer.js index 757a0fa..915aae6 100644 --- a/scripts/explorer.js +++ b/scripts/explorer.js @@ -42,6 +42,8 @@ jQuery(document).ready(function($) /** MENU **/ /**********/ + fancyboxInit(data, true); + var availableOptions = []; var selectedOptions = []; @@ -556,10 +558,5 @@ jQuery(document).ready(function($) setTable(); } } - - // fancybox configuration - $.getScript("scripts/fancybox.js", function() { - fancyboxInit(data, true); - }); }); }); \ No newline at end of file diff --git a/scripts/exposition.js b/scripts/exposition.js index 610abc5..8647a64 100644 --- a/scripts/exposition.js +++ b/scripts/exposition.js @@ -2,6 +2,8 @@ jQuery(document).ready(function($) { $.getJSON("data.json", function(data) { + fancyboxInit(data, false); + window.pageSize = 14; var paintingList = []; @@ -18,12 +20,12 @@ jQuery(document).ready(function($) if (canDisplay) { paintingHtml += 'active">' - paintingHtml += 'Tableau ' + i.number + ''; + paintingHtml += 'Tableau ' + i.number + ''; } else { paintingHtml += 'inactive">' - paintingHtml += 'Tableau ' + i.number + ''; + paintingHtml += 'Tableau ' + i.number + ''; } paintingHtml += '' + i.title; if (i.year != '—') @@ -46,11 +48,7 @@ jQuery(document).ready(function($) if (targetPage > 0) $("#pagination").pagination('go', targetPage); - }); - // fancybox configuration - $.getScript("scripts/fancybox.js", function() { - fancyboxInit(data, false); }); }); }); \ No newline at end of file