From 01df965d66fa7223e98036908ed4f60dda5942f8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 19 Mar 2019 18:20:05 +0100 Subject: support logging of cancelled journeys --- public/static/js/travelynx-actions.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'public/static/js/travelynx-actions.js') diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js index 0a3d092..d47df77 100644 --- a/public/static/js/travelynx-actions.js +++ b/public/static/js/travelynx-actions.js @@ -44,6 +44,24 @@ $(document).ready(function() { var req = { action: 'undo', }; - tvly_run(link, req, window.location.href); + tvly_run(link, req, '/'); + }); + $('.action-cancelled-from').click(function() { + var link = $(this); + var req = { + action: 'cancelled_from', + station: link.data('station'), + train: link.data('train'), + }; + tvly_run(link, req, '/'); + }); + $('.action-cancelled-to').click(function() { + var link = $(this); + var req = { + action: 'cancelled_to', + station: link.data('station'), + force: true, + }; + tvly_run(link, req, '/'); }); }); -- cgit v1.2.3