Skip to content

Commit

Permalink
Don't create search dashlets if the search string is empty
Browse files Browse the repository at this point in the history
refs #8668
  • Loading branch information
lippserd committed Mar 12, 2015
1 parent 515fe32 commit dc6b472
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions library/Icinga/Web/Widget/SearchDashboard.php
Expand Up @@ -60,6 +60,10 @@ protected function loadSearchDashlets($searchString)
foreach ($manager->getLoadedModules() as $module) {
$moduleSearchUrls = $module->getSearchUrls();
if (! empty($moduleSearchUrls)) {
if ($searchString === '') {
$pane->add(t('Ready to search'), 'search/hint');
return;
}
$searchUrls = array_merge($searchUrls, $moduleSearchUrls);
}
}
Expand All @@ -72,12 +76,6 @@ protected function loadSearchDashlets($searchString)
Url::fromPath($searchUrl->url, array('q' => $searchString))
);
}

if ($searchString === '' && $pane->hasDashlets()) {
$pane->removeDashlets();
$pane->add('Ready to search', 'search/hint');
return;
}
}

/**
Expand Down

0 comments on commit dc6b472

Please sign in to comment.