aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/offline.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/web/cobrands/fixmystreet/offline.js b/web/cobrands/fixmystreet/offline.js
index c98d76210..7b9be4c6c 100644
--- a/web/cobrands/fixmystreet/offline.js
+++ b/web/cobrands/fixmystreet/offline.js
@@ -383,12 +383,14 @@ if ($('#offline_list').length) {
$(this).find('h3').prepend('<em>Offline update data saved</em> ');
}
});
- $('#offline_clear').html('<button id="js-clear-localStorage">Clear offline data</button>');
+ $('#offline_clear').css('margin-top', '5em').html('<button id="js-clear-localStorage">Clear offline data</button>');
$('#js-clear-localStorage').click(function() {
- fixmystreet.offline.removeReports(fixmystreet.offlineData.getCachedUrls());
- fixmystreet.offlineData.clearForms();
- localStorage.removeItem('/my/planned');
- alert('Offline data cleared');
+ if (window.confirm("Are you sure?")) {
+ fixmystreet.offline.removeReports(fixmystreet.offlineData.getCachedUrls());
+ fixmystreet.offlineData.clearForms();
+ localStorage.removeItem('/my/planned');
+ alert('Offline data cleared');
+ }
});
}
}