summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-07-14 21:05:07 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-07-14 21:05:07 +0200
commitf01f108f94f53846268188d8e9a63ad36613bcab (patch)
tree72bb9d30c1a87acf27dabab9658db2ab865f7ac1
parent7a34f64eba2aec25c4493910963783aeb4c4a8c7 (diff)
increased click area for checkin
-rw-r--r--public/static/js/travelynx-actions.js8
-rw-r--r--templates/_connections.html.ep12
-rw-r--r--templates/departures.html.ep6
3 files changed, 16 insertions, 10 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js
index 7558e69..a1fa685 100644
--- a/public/static/js/travelynx-actions.js
+++ b/public/static/js/travelynx-actions.js
@@ -65,7 +65,13 @@ function odelay(sched, rt) {
function tvly_run(link, req, err_callback) {
var error_icon = '<i class="material-icons">error</i>';
- var progressbar = $('<div class="progress"><div class="indeterminate"></div></div>');
+ var progressbar;
+ if (link.data('tr')) {
+ progressbar = $('<tr><td colspan="' + link.data('tr') + '"><div class="progress"><div class="indeterminate"></div></div></td></tr>');
+ }
+ else {
+ progressbar = $('<div class="progress"><div class="indeterminate"></div></div>');
+ }
link.hide();
link.after(progressbar);
$.post('/action', req, function(data) {
diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep
index d09f0c0..9b009df 100644
--- a/templates/_connections.html.ep
+++ b/templates/_connections.html.ep
@@ -7,10 +7,10 @@
% $td_class = 'cancelled';
% $link_class = 'action-cancelled-from';
% }
- <tr>
+ <tr class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>">
<td class="<%= $td_class %>">
% if ($checkin_from) {
- <a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $train->line %></a>
+ <a><%= $train->line %></a>
% }
% else {
%= $train->line
@@ -18,7 +18,7 @@
</td>
<td class="<%= $td_class %>">
% if ($checkin_from) {
- <a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $via %></a>
+ <a><%= $via %></a>
% }
% else {
%= $via
@@ -70,10 +70,10 @@
% $td_class = 'cancelled';
% $link_class = 'action-cancelled-from';
% }
- <tr>
+ <tr class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>" data-tr="4">
<td class="<%= $td_class %>">
% if ($checkin_from) {
- <a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $train->line %></a>
+ <a><%= $train->line %></a>
% }
% else {
%= $train->line
@@ -81,7 +81,7 @@
</td>
<td class="<%= $td_class %>">
% if ($checkin_from) {
- <a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $via %></a>
+ <a><%= $via %></a>
% }
% else {
%= $via
diff --git a/templates/departures.html.ep b/templates/departures.html.ep
index 91b3331..220d951 100644
--- a/templates/departures.html.ep
+++ b/templates/departures.html.ep
@@ -86,14 +86,14 @@
</td>
</tr>
% }
- <tr>
+ <tr class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>" data-tr="3">
<td>
- <a class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>">
+ <a>
<%= $result->line %>
</a>
</td>
<td class="<%= $td_class %>">
- <a class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>">
+ <a>
<%= $result->destination %>
</a>
</td>