Skip to content

Commit

Permalink
Add bikes and stands availabilities on stations list
Browse files Browse the repository at this point in the history
  • Loading branch information
piRstone committed Aug 21, 2020
1 parent df5c78e commit 70ea199
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions css/stations.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ span.number {
margin-bottom: 0;
}

#stations-list .station-to-add span {
float: right;
color: black;
font-size: 12px;
font-weight: normal;
}

#stations-list .station-to-add:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
Expand Down
11 changes: 10 additions & 1 deletion js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,16 @@ function showStationsList(e) {
if (!list.hasClass('loaded')) {
for(var i=0 ; i < stations.length ; i++) {
var stationName = stations[i].name.replace('-', ' - ');
list.append('<p id="add-station-' + stations[i].number + '" class="station-to-add">' + stationName + '</p>');
var p = $('<p id="add-station-' + stations[i].number + '" class="station-to-add">' + stationName + '</p>');
p.append(
'<span style="text-align: right">🚲 ' +
stations[i].available_bikes +
' 📍 ' +
stations[i].available_bike_stands +
'</span>'
);

list.append(p);
$('#add-station-'+stations[i].number).click(addStation);
}
list.addClass('loaded');
Expand Down

0 comments on commit 70ea199

Please sign in to comment.