Improved www.ttss.krakow.pl
Jacek Kowalski
2019-07-06 94177cee799eaf7c493b0fd1137d7eeaec4fd918
Fix edge cases (no results, query empty) in find function
1 files modified
10 ■■■■■ changed files
map.js 10 ●●●●● patch | view | raw | blame | history
map.js
@@ -180,6 +180,11 @@
        if(query === this.query) return;
        this.query = query;
        
        if(query === '') {
            deleteChildren(this.results);
            return;
        }
        var features = [];
        stops_type.forEach(function(stop_type) {
            if(stop_type.substr(0,1) === 'p') return;
@@ -704,6 +709,11 @@
function listFeatures(features) {
    var div = document.createElement('div');
    
    if(features.length == 0) {
        addParaWithText(div, lang.no_results);
        return div;
    }
    addParaWithText(div, lang.select_feature);
    
    var feature, p, a, full_type, typeName;