From a269a95cf0aef62b1f1dbca8de698d7b2f61f52b Mon Sep 17 00:00:00 2001 From: anup kumar Date: Wed, 14 Feb 2018 12:51:49 +0100 Subject: [PATCH] Fix the bug --- config/plugins/webhooks/demo/search/script.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config/plugins/webhooks/demo/search/script.js b/config/plugins/webhooks/demo/search/script.js index 339d4b57f43..6724157d5cb 100644 --- a/config/plugins/webhooks/demo/search/script.js +++ b/config/plugins/webhooks/demo/search/script.js @@ -471,7 +471,6 @@ $(document).ready(function() { removed_results_key = "removed_results", pinned_results_key = "pinned_results", class_tool_link = "tool-search-link"; - _.each( Galaxy.config.toolbox_in_panel, function( section ) { if( section.model_class === "ToolSection" ) { var all_tools = section.elems, @@ -506,14 +505,15 @@ $(document).ready(function() { tools_template ); } } - else if( section.model_class === "Tool" || section.model_class === "DataSourceTool" ) { - var attributes = section.attributes; - if( item === attributes.id ) { + else if( section.model_class === "Tool" ) { + // check if the tool is present in the search results + if( _.contains( search_result, section.id ) ) { + var attributes = section.attributes ? section.attributes : section; if( !self.checkItemPresent( attributes.id, removed_results_key, self ) ) { tool_template = tool_template + self._buildLinkTemplate( attributes.id, attributes.link, - attributes.name, attributes.description, attributes.target, - class_tool_link, self.checkItemPresent( attributes.id, pinned_results_key, self ), - attributes.version, attributes.min_width, attributes.form_style ); + attributes.name, attributes.description, attributes.target, + class_tool_link, self.checkItemPresent( attributes.id, pinned_results_key, self ), + attributes.version, attributes.min_width, attributes.form_style ); } } }