From 0201f60b52cd03c9b227cd968168416f3dd2a9be Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 2 Feb 2016 15:23:05 +0100 Subject: [PATCH] (ui) resize menu search on focus / unfocus, reload page if navigated to the same url --- .../mvc/app/views/layouts/default.volt | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/opnsense/mvc/app/views/layouts/default.volt b/src/opnsense/mvc/app/views/layouts/default.volt index b0c7ddc37..82343cf07 100644 --- a/src/opnsense/mvc/app/views/layouts/default.volt +++ b/src/opnsense/mvc/app/views/layouts/default.volt @@ -120,14 +120,28 @@ 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(); + }); });