diff --git a/module/search/control.php b/module/search/control.php
index 4172a0dc04..f5f952177a 100644
--- a/module/search/control.php
+++ b/module/search/control.php
@@ -69,7 +69,10 @@ class search extends control
{
$queryID = $this->search->saveQuery();
if(!$queryID) die(js::error(dao::getError()));
- die(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID)}"));
+
+ $onMenuBarFunc = '';
+ if($this->post->onMenuBar) $onMenuBarFunc = "if(typeof parent.parent.setQueryBar === 'function') parent.parent.setQueryBar($queryID, '{$this->post->title}')";
+ die(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID);$onMenuBarFunc}"));
}
$this->view->module = $module;
$this->view->onMenuBar = $onMenuBar;
diff --git a/module/testcase/js/browse.js b/module/testcase/js/browse.js
index 2ef7983880..461a05270a 100644
--- a/module/testcase/js/browse.js
+++ b/module/testcase/js/browse.js
@@ -56,3 +56,8 @@ $(document).ready(function()
$('#modulemenu > .nav > li[data-id=' + browseType + ']').addClass('active');
}
});
+
+function setQueryBar(queryID, title)
+{
+ $('#bysearchTab').before("
" + title + "");
+}
diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php
index b924363056..003eaa50a9 100644
--- a/module/testcase/view/browse.html.php
+++ b/module/testcase/view/browse.html.php
@@ -20,6 +20,8 @@ js::set('caseBrowseType', ($browseType == 'bymodule' and $this->session->caseBro
js::set('moduleID' , $moduleID);
js::set('confirmDelete', $lang->testcase->confirmDelete);
js::set('batchDelete', $lang->testcase->confirmBatchDelete);
+js::set('productID', $productID);
+js::set('branch', $branch);
?>