From 1993ae2ed2ee8ec2bc53a57dec78d733bb921b9d Mon Sep 17 00:00:00 2001
From: Johannes Meyer <johannes.meyer@netways.de>
Date: Thu, 25 Aug 2016 08:54:04 +0200
Subject: [PATCH] js: Fix that the menu is not reloaded in case no search is
 available

fixes #12541
---
 public/js/icinga/behavior/form.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/public/js/icinga/behavior/form.js b/public/js/icinga/behavior/form.js
index 750f02223..eae75168d 100644
--- a/public/js/icinga/behavior/form.js
+++ b/public/js/icinga/behavior/form.js
@@ -60,10 +60,9 @@
             if ($search[0] === document.activeElement) {
                 return null;
             }
-            var search = $container.find('#search').val();
-            if (search.length) {
+            if ($search.length) {
                 var $content = $('<div></div>').append(content);
-                $content.find('#search').attr('value', search).addClass('active');
+                $content.find('#search').attr('value', $search.val()).addClass('active');
                 return $content.html();
             }
             return content;