From 622033802405f0c4c6e5b60103d3cdc6bd0eda1c Mon Sep 17 00:00:00 2001 From: nadrad Date: Sat, 10 Sep 2022 00:30:05 +0200 Subject: [PATCH] search result to prev if there's no next --- h-m-m | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/h-m-m b/h-m-m index 8460510..09b2844 100755 --- a/h-m-m +++ b/h-m-m @@ -1234,7 +1234,8 @@ function search(&$mm) return; } - next_search_result($mm); + if (!next_search_result($mm)) + previous_search_result($mm); } function previous_search_result(&$mm) @@ -1262,10 +1263,7 @@ function previous_search_result(&$mm) } if ($nid<0) - { - display($mm); - return; - } + return false; $mm['active_node'] = $nid; display($mm); @@ -1296,10 +1294,7 @@ function next_search_result(&$mm) } if ($nid<0) - { - display($mm); - return; - } + return false; $mm['active_node'] = $nid; display($mm);