From 95fb0aa3c7673a570e12d8a2647868ccef12add5 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 2 Feb 2016 15:24:43 +0100 Subject: [PATCH] (legacy/ui) resize menu search on focus / unfocus, reload page if navigated to the same url --- src/www/head.inc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/www/head.inc b/src/www/head.inc index ab4d1b2f2..1afff7d25 100644 --- a/src/www/head.inc +++ b/src/www/head.inc @@ -225,11 +225,27 @@ $pagetitle .= sprintf(' | %s.%s', $config['system']['hostname'], $config['system return true; }, afterSelect: function(item){ - window.location.href = item.id; + // (re)load page + if (window.location.href.split("#")[0].indexOf(item.id.split("#")[0]) > -1 ) { + // same url, different hash marker + window.location.href = item.id; + window.location.reload(); + } else { + window.location.href = item.id; + } } }); } }); + // change search input size on focus() to fit results + $("#menu_search_box").focus(function(){ + $("#menu_search_box").css('width', '450px'); + $("#menu_messages").hide(); + }); + $("#menu_search_box").focusout(function(){ + $("#menu_search_box").css('width', '250px'); + $("#menu_messages").show(); + }); }); //]]>