Skip to content

Commit 0cbc25d

Browse files
committed
make time cells of equal width
1 parent f09590a commit 0cbc25d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/js/map_stops.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ function display_stop_times(stop_routes) {
151151
}
152152

153153
const tbody = document.createElement('tbody');
154+
let first_row = true;
154155
for(const route of stop_routes) {
155156
const row0 = document.createElement('tr');
156157
row0.classList.add('text-center', 'align-middle');
@@ -202,13 +203,20 @@ function display_stop_times(stop_routes) {
202203

203204
const popover_btn = `<i popovertarget="stop-time-popover" onclick="document.querySelector('#stop-time-popover').innerHTML = decodeURI(this.dataset.popoverContent); document.querySelector('#stop-time-popover').showPopover();" data-popover-content='${popover_content}' class="bi bi-info-circle"></i>`;
204205
td.innerHTML = `<span class="text-nowrap">${r[0]} ${r[0] != '-' ? popover_btn : ''}</span><br>${r[1] ? r[1] : ''}`;
206+
if(first_row) {
207+
td.classList.add('col-3');
208+
}
205209
row.appendChild(td);
206210
}
207211
for(let i = route.times.length; i < 4; i++) {
208212
const td = document.createElement('td');
209213
td.textContent = '-';
214+
if(first_row) {
215+
td.classList.add('col-3');
216+
}
210217
row.appendChild(td);
211218
}
219+
first_row = false;
212220
}
213221
tbody.appendChild(row0);
214222
tbody.appendChild(row);

src/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
left: 50%;
1010
max-height: 45%;
1111
overflow-y: auto;
12-
min-width: 300px;
12+
min-width: 390px;
1313
max-width: 500px;
1414
transform: translateX(-50%);
1515
}

0 commit comments

Comments
 (0)