Show/hide tool search based on user preferences.

This commit is contained in:
Jeremy Goecks
2012-04-02 11:36:35 -04:00
parent 3158f08232
commit 1013b6f210
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -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;
},
+3 -3
View File
@@ -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 } );