aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 8935712cc..b3f6f5e60 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -301,6 +301,27 @@ $.extend(fixmystreet.set_up, {
$('#form_rznvy').removeClass();
$('#email').removeClass();
});
+
+ $('#planned_form').submit(function(e) {
+ if (e.metaKey || e.ctrlKey) {
+ return;
+ }
+ e.preventDefault();
+ var $form = $(this),
+ $change = $form.find("input[name='change']" ),
+ $submit = $form.find("input[type='submit']" ),
+ data = $form.serialize() + '&ajax=1';
+
+ $.post(this.action, data, function(data) {
+ if (data.outcome == 'add') {
+ $change.val('remove');
+ $submit.val($submit.data('remove'));
+ } else if (data.outcome == 'remove') {
+ $change.val('add');
+ $submit.val($submit.data('add'));
+ }
+ });
+ });
},
geolocation: function() {