Commit b04977b3 authored by Michael Ochmann's avatar Michael Ochmann
Browse files

added clearing localstorage

parent f74f2f9f
......@@ -19,6 +19,11 @@ class Settings {
localStorage.setItem("settings", JSON.stringify(this.settings));
}
clear() {
this.settings = {};
localStorage.clear();
}
static Instance() {
if (Settings.INSTANCE === null)
Settings.INSTANCE = new Settings();
......
......@@ -27,18 +27,18 @@ class HeightMapViewController extends UIViewController {
}
capture() {
navigator.geolocation.getCurrentPosition(position => {
/* navigator.geolocation.getCurrentPosition(position => {
this.addPoint(new GeoPoint(
position.coords.latitude,
position.coords.longitude,
position.coords.altitude
));
});
/* this.addPoint(new GeoPoint(
});*/
this.addPoint(new GeoPoint(
Std.Random(136, 150),
Std.Random(60, 150),
Std.Random(80, 159)
));*/
));
}
/**
......
......@@ -17,6 +17,10 @@ class SettingsViewController extends UIViewController {
$("#selectDistanceInterval").on("change", element => {
Settings.set("distanceInterval", element.value());
});
$("#deleteAll").click(element => {
if (confirm("Do you really want to clear all your data?"))
Settings.clear();
});
}
render() {
......@@ -35,7 +39,7 @@ class SettingsViewController extends UIViewController {
</select>
</span>
</li>
<li><a style="color: red;"><span class="fa fa-trash" style="margin-right: 10px;"></span> Delete all Data</a></li>
<li id="deleteAll"><a style="color: red;"><span class="fa fa-trash" style="margin-right: 10px;"></span> Delete all Data</a></li>
</ul>
`;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment