Improved www.ttss.krakow.pl
Jacek Kowalski
2017-04-12 73da941644c4ee6cd03437815690c2cfaae4d958
Allow changing current stop by clicking on one in tram schedule table
1 files modified
2 ■■■■■ changed files
index.js 2 ●●●●● patch | view | raw | blame | history
index.js
@@ -257,6 +257,7 @@
            addCellWithText(tr, data.old[i].stop_seq_num + '. ' + data.old[i].stop.name);
            
            tr.className = 'active';
            tr.addEventListener('click', function(stopId){ return function(){ loadTimes(stopId); } }(data.old[i].stop.shortName) );
            route_table.appendChild(tr);
        }
        
@@ -268,6 +269,7 @@
            if(data.actual[i].status == 'STOPPING') {
                tr.className = 'success';
            }
            tr.addEventListener('click', function(stopId){ return function(){ loadTimes(stopId); } }(data.actual[i].stop.shortName) );
            route_table.appendChild(tr);
        }
    }).fail(fail_ajax);