diff --git a/static/scripts/backbone/tools.js b/static/scripts/backbone/tools.js index 203f784ad8f..26830fbc8bc 100644 --- a/static/scripts/backbone/tools.js +++ b/static/scripts/backbone/tools.js @@ -101,7 +101,7 @@ var ToolPanelSection = BaseModel.extend({ * indicates that query was not run; if not null, results are from search using * query. */ -var ToolSearch = Backbone.Model.extend({ +var ToolSearch = BaseModel.extend({ defaults: { spinner_url: "", search_url: "", @@ -320,6 +320,9 @@ var ToolSearchView = Backbone.View.extend({ render: function() { this.$el.append( this.template(this.model.toJSON()) ); + if (!this.model.is_visible()) { + this.$el.hide(); + } return this; }, diff --git a/templates/root/tool_menu.mako b/templates/root/tool_menu.mako index 7a5525bb21e..ab1570a38de 100644 --- a/templates/root/tool_menu.mako +++ b/templates/root/tool_menu.mako @@ -21,9 +21,9 @@ <% # Set up for creating tool panel. - show_tool_search = "true" + tool_search_hidden = "false" if trans.user and trans.user.preferences.get( "show_tool_search", "False" ) == "False": - show_tool_search = "false" + tool_search_hidden = "true" dictified_panel = [] for key, val in trans.app.toolbox.tool_panel.items(): @@ -37,7 +37,7 @@ // Set up search. tool_search = new ToolSearch( {spinner_url: "${h.url_for('/static/images/loading_small_white_bg.gif')}", search_url: "${h.url_for( controller='root', action='tool_search' )}", - visible: ${show_tool_search} } ); + hidden: ${tool_search_hidden} } ); // Set up tool panel. tool_panel = new ToolPanel( { tool_search: tool_search } );