diff options
-rw-r--r-- | askbot/context.py | 4 | ||||
-rw-r--r-- | askbot/media/js/live_search.js | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/askbot/context.py b/askbot/context.py index 3e0bf657..abd283e1 100644 --- a/askbot/context.py +++ b/askbot/context.py @@ -60,7 +60,9 @@ def application_settings(request): #for some languages we will start searching for shorter words if current_language == 'ja': - min_search_word_length = 2 + #we need to open the search box and show info message about + #the japanese lang search + min_search_word_length = 1 else: min_search_word_length = my_settings['MIN_SEARCH_WORD_LENGTH'] diff --git a/askbot/media/js/live_search.js b/askbot/media/js/live_search.js index b4f3d621..b6710e95 100644 --- a/askbot/media/js/live_search.js +++ b/askbot/media/js/live_search.js @@ -149,6 +149,18 @@ SearchDropMenu.prototype.hideWaitIcon = function() { } }; +SearchDropMenu.prototype.hideHeader = function() { + if (this._header) { + this._header.hide(); + } +}; + +SearchDropMenu.prototype.showHeader = function() { + if (this._header) { + this._header.show(); + } +}; + SearchDropMenu.prototype.createDom = function() { this._element = this.makeElement('div'); this._element.addClass('search-drop-menu'); @@ -507,6 +519,9 @@ FullTextSearch.prototype.getSearchQuery = function() { FullTextSearch.prototype.renderTitleSearchResult = function(data) { var menu = this._dropMenu; menu.hideWaitIcon(); + if (data.length > 0) { + menu.hideHeader(); + } menu.setData(data); menu.render(); menu.show(); @@ -793,6 +808,7 @@ FullTextSearch.prototype.makeKeyDownHandler = function() { past the minimum length to trigger search */ dropMenu.show(); dropMenu.showWaitIcon(); + dropMenu.showHeader(); } else { //close drop menu if we were deleting the query dropMenu.reset(); |