Skip to content

Commit

Permalink
make sure that empty searches in filters drop back to the fundamental…
Browse files Browse the repository at this point in the history
… query; remove some dead code; work on geneontology/amigo#317 and #1
  • Loading branch information
kltm committed Mar 18, 2016
1 parent b146235 commit ffcf6f1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/live_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ var live_filters = function(interface_id, manager, golr_conf_obj,
'display_free_text_p': true,
'free_text_placeholder': 'Free-text filter',
'display_accordion_p': true,
//'minimum_free_text_length': 3, // wait for three characters or more
'minimum_free_text_length': 0, //
'on_update_callback': function(){}
};
var folding_hash = in_argument_hash || {};
Expand All @@ -95,7 +93,6 @@ var live_filters = function(interface_id, manager, golr_conf_obj,
this._display_free_text_p = arg_hash['display_free_text_p'];
this._free_text_placeholder = arg_hash['free_text_placeholder'];
this._display_accordion_p = arg_hash['display_accordion_p'];
this._minimum_free_text_length = arg_hash['minimum_free_text_length'];
this._on_update_callback = arg_hash['on_update_callback'];

///
Expand Down Expand Up @@ -591,14 +588,18 @@ var live_filters = function(interface_id, manager, golr_conf_obj,
var tmp_q = manager.get_query();
var input_text = jQuery(this).val();
manager.set_query(input_text);

// If the manager feels like it's right, trigger.
if( manager.sensible_query_p() ){
ll('keeping set query: ' + input_text);
// Set the query to be more "usable" just
// before triggering (so the tests can't be
// confused by our switch).
manager.set_comfy_query(input_text);
if( input_text === '' ){
manager.set_comfy_query(manager.get_fundamental_query());
}else{
manager.set_comfy_query(input_text);
}
manager.search();

// We are now searching--show it.
Expand Down Expand Up @@ -928,8 +929,8 @@ var live_filters = function(interface_id, manager, golr_conf_obj,
// ll("shield what: " + bbop.what_is(resp));
// ll("shield resp: " + bbop.dump(resp));

// First, extract the fields from the
// minimal response.
// First, extract the fields from the minimal
// response.
var fina = call_time_field_name;
var flist = resp.facet_field(call_time_field_name);

Expand Down

0 comments on commit ffcf6f1

Please sign in to comment.