Commit 96048f41 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Show "Nothing found" text when search fails.

That's much better than the previous flickering where before performing
the search the dropdown was shown and after getting no results it was
hidden again.

Better to just show a message "Nothing found" - this will also make
clear to the user that the search found no results and didn't just fail
for whatever reason.
parent 43bcbaec
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -148,11 +148,8 @@ Ext.define('Docs.controller.Search', {
        this.getDropdown().getStore().loadData(results.slice(start, end));
        // position dropdown below search box
        this.getDropdown().alignTo('search-field', 'bl', [-12, -2]);
        // hide dropdown when nothing found
        if (results.length === 0) {
            this.getDropdown().hide();
        }
        else {

        if (results.length > 0) {
            // auto-select first result
            this.getDropdown().getSelectionModel().select(0);
        }
+7 −3
Original line number Diff line number Diff line
@@ -50,9 +50,13 @@ Ext.define('Docs.view.search.Dropdown', {
                '</div>',
            '</tpl>',
            '<div class="footer">',
                '<tpl if="this.getTotal()">',
                    '<a href="#" class="prev">&lt;</a>',
                    '<span class="total">{[this.getStart()+1]}-{[this.getEnd()]} of {[this.getTotal()]}</span>',
                    '<a href="#" class="next">&gt;</a>',
                '<tpl else>',
                    '<span class="total">Nothing found</span>',
                '</tpl>',
            '</div>',
            {
                getCls: function(meta) {