Repository: incubator-blur
Updated Branches:
  refs/heads/apache-blur-0.2 bdf341726 -> 61facfe6a


Defaulted search to select first table


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/61facfe6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/61facfe6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/61facfe6

Branch: refs/heads/apache-blur-0.2
Commit: 61facfe6a70110a69169b26b2e4d07b63d294ae9
Parents: bdf3417
Author: Chris Rohr <[email protected]>
Authored: Thu Jun 12 17:00:55 2014 -0400
Committer: Chris Rohr <[email protected]>
Committed: Thu Jun 12 17:00:55 2014 -0400

----------------------------------------------------------------------
 .../src/main/webapp/js/blurconsole.search.js            | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/61facfe6/contrib/blur-console/src/main/webapp/js/blurconsole.search.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.search.js 
b/contrib/blur-console/src/main/webapp/js/blurconsole.search.js
index b81ea70..d593bab 100644
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.search.js
+++ b/contrib/blur-console/src/main/webapp/js/blurconsole.search.js
@@ -113,7 +113,7 @@ blurconsole.search = (function () {
                        function buildSuggestionObject(query, hint, value) {
                                return 
{value:query.substring(0,query.lastIndexOf(hint)) + value, display:value};
                        }
-                       var table = $('#tableChooser').val();
+                       var table = stateMap.$currentTable;
                        if(table && table !== '' && 
blurconsole.model.tables.isDataLoaded()) {
                                query = query.toLowerCase();
                                var parsedQuery = 
_parseQueryForTypeahead(query);
@@ -185,6 +185,9 @@ blurconsole.search = (function () {
                jqueryMap.$optionsTrigger.on('shown.bs.popover', 
_updateOptionPopover);
                $(document).on('change', '.popover select', _persistOptions);
                jqueryMap.$facetTrigger.on('click', _popupFacetDialog);
+               jqueryMap.$tableField.on('change', function(evt) {
+                       stateMap.$currentTable = $(evt.currentTarget).val();
+               });
        }
 
        function _unregisterPageEvents() {
@@ -197,6 +200,7 @@ blurconsole.search = (function () {
                        jqueryMap.$optionsTrigger.popover('destroy');
                        jqueryMap.$optionsTrigger.off('shown.bs.popover');
                        $(document).off('change');
+                       jqueryMap.$tableField.off('change');
                        //jqueryMap.$facetTrigger.off('click');
                }
        }
@@ -416,7 +420,6 @@ blurconsole.search = (function () {
        function _loadTableList() {
                var tableMap = blurconsole.model.tables.getAllEnabledTables();
 
-               jqueryMap.$tableSelectorStatusOption.html('Loading Tables...');
                jqueryMap.$tableField.find('optgroup').remove();
 
                $.each(tableMap, function(cluster, tables) {
@@ -432,7 +435,10 @@ blurconsole.search = (function () {
                        }
                });
 
-               jqueryMap.$tableSelectorStatusOption.html('Choose Table');
+               if (jqueryMap.$tableSelectorStatusOption && 
blurconsole.utils.keys(tableMap).length > 0) {
+                       jqueryMap.$tableSelectorStatusOption.remove();
+                       jqueryMap.$tableSelectorStatusOption = null;
+               }
        }
 
        function _popupFacetDialog() {

Reply via email to