Skip to content

Commit

Permalink
Fix adv search first selected dropdown item
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Foster committed Jun 12, 2013
1 parent 9574b7c commit 0c70b48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions static/js/ux-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ IONUX.Views.AdvancedSearch = Backbone.View.extend({

},
filter_fields: [
{field: 'name' , label: 'Name' , values: []} ,
{field: 'ooi_short_name' , label: 'OOI Data Product Code' , values: []} ,
{field: 'ooi_product_name' , label: 'Data Product Type' , values: []} ,
{field: 'description' , label: 'Description' , values: []} ,
{field: 'instrument_family' , label: 'Instrument Family' , values: []} ,
{field: 'lcstate' , label: 'Lifecycle State' , values: ['DRAFT','PLANNED','DEVELOPED','INTEGRATED','DEPLOYED','RETIRED']} ,
{field: 'name' , label: 'Name' , values: []} ,
{field: 'alt_ids' , label: 'OOI Reference Designator' , values: []} ,
{field: 'name' , label: 'Organization' , values: []} ,
{field: 'platform_family' , label: 'Platform Family' , values: []} ,
Expand Down Expand Up @@ -507,8 +507,9 @@ IONUX.Views.AdvancedSearch = Backbone.View.extend({
target.parents('.filter-item').after(filter_item);
}

// preselect name field
filter_item.find('select[name="filter_var"] option[value="name"]:contains("Name")').attr('selected', 'selected').change();
// seems to be no way to get this to cooperate, so we'll just select the first item
var sel = filter_item.find('select[name="filter_var"]');
sel.change();
},
remove_filter_item: function(evt) {
var this_filter_item = $(evt.target).parents('.filter-item');
Expand Down

0 comments on commit 0c70b48

Please sign in to comment.