From 8bd34f7b442be2941f81965b47f49c793ffa3dc7 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 1 Dec 2019 16:50:17 +0100 Subject: [PATCH] Optimisation --- core/core.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/core.php b/core/core.php index 81bd7741..72664781 100644 --- a/core/core.php +++ b/core/core.php @@ -1395,12 +1395,15 @@ class core extends common { if($output['redirect']) { // Redirection Lity if ($output['script'] === 'redirectdatality') { - $this->addOutput ([ - 'content' => 'Lien', + $this->addOutput ([ 'script' => '$(document).on("lity:close", function(event, instance) { location.replace("' . helper::baseURl() . '"); }); - document.getElementById("redirectdatality").click();' + // Open a URL in a lightbox + var lightbox = lity("'. $output['redirect'] .'"); + + // Bind as an event handler + $(document).on("click", "[data-lightbox]", lity);' ]); } else { http_response_code(301);