mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Show/hide tool search based on user preferences.
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
@@ -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 } );
|
||||
|
||||
Reference in New Issue
Block a user