diff --git a/index.html b/index.html
index 593ea03..88f7cbd 100644
--- a/index.html
+++ b/index.html
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -41,6 +41,7 @@
+
+
+
@@ -284,16 +327,20 @@
// get browser location when button "locate" is clicked
$("#locate").on("click", function() {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(function(position) {
- var item = {
- lat: position.coords.latitude,
- lon: position.coords.longitude
- }
- SL.Calendar.getGeoCode(item);
- });
+ if ( $("body").attr("use") == "offline" ) {
+ SL.App.geoLocate();
} else {
- alert("Geolocation is not supported by this browser.");
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ var item = {
+ lat: position.coords.latitude,
+ lon: position.coords.longitude
+ }
+ SL.Calendar.getGeoCode(item);
+ });
+ } else {
+ alert("Geolocation is not supported by this browser.");
+ }
}
});
@@ -312,7 +359,7 @@
});
// "About" modal
- $('#about').on('click', SL.Calendar.about);
+ SL.Calendar.about();
// "Generate" button in Settings
$('#generate').on("click", function(e) {
@@ -337,14 +384,14 @@
// "Reset" button in navbar menu bar
$('#filterreset').on('click', function() {
- if ( $("body").attr("use") == "offline" ) {
+ if ( $("body").attr("use") == "offline" && document.getElementById("loadpreset") != null ) {
$("#grid").empty();
- if ( $('#calendar').data('isotope') ) $('#calendar').isotope('destroy');
}
$('.actionlistfilter input').prop('checked', false);
$('.filteroptions input').prop('checked', false);
filters = {};
$('#calendar').isotope({ filter: '*' });
+ if ( $('#calendar').data('isotope') ) $('#calendar').isotope('destroy');
});
/*--
@@ -403,6 +450,10 @@
});
});
+ if ( $("body").attr("use") == "offline" ) {
+ SL.App.authorize();
+ }
+