From f23de3204ddad0f53d5014945f09d414930fa080 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 12 Jan 2022 12:41:38 +0000 Subject: [PATCH] wait #5020 @0.5 --- .../Util/html5/master/class.ws.html5.compiler.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 213f65ca0..d0c46bdda 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -30,7 +30,7 @@ class wsHTML5Compiler 'js/libs/jquery/jquery.mousewheel.min.js', 'js/libs/jquery/jquery.hashchange.min.js', 'js/libs/jquery/jquery.scrollto.min.js', - ], + ], 'aria' => ['js/libs/aria/radio.js',], 'bluebird' => ['js/libs/bluebird.min.js'], 'screenfull' => ['js/libs/screenfull.min.js'], @@ -3474,6 +3474,19 @@ height="0" width="0" style="display:none;visibility:hidden"> $list = $this->config->articlesList ?? []; $nb = count($list); + + usort($list, function ($a, $b) { + if ($a['page'] == $b['page']) { + $ea = explode('-', $a['id']); + $eb = explode('-', $b['id']); + if (is_numeric($ea[0]) && is_numeric($eb[0])) { + return $ea[0] - $eb[0]; + } + return strcmp($a['id'], $b['id']); + } + return $a['page'] - $b['page']; + }); + foreach ($list as $k => $item) { $nextIndex = ($k + 1) % $nb; $prevIndex = ($k - 1 + $nb) % $nb; -- 2.39.5