diff --git a/src/flavors/default/config.yml b/src/flavors/default/config.yml index a9466c043..dcfd98b4f 100644 --- a/src/flavors/default/config.yml +++ b/src/flavors/default/config.yml @@ -272,7 +272,7 @@ pages: - title: _(About) slug: about name: overview - # start_page: true + start_page: true - title: _(Why Shareabouts?) slug: why diff --git a/src/sa_web/static/js/routes.js b/src/sa_web/static/js/routes.js index fb15fa12c..a865b6aa4 100644 --- a/src/sa_web/static/js/routes.js +++ b/src/sa_web/static/js/routes.js @@ -71,7 +71,7 @@ var Shareabouts = Shareabouts || {}; Backbone.history.start(historyOptions); // Load the default page only if there is no page already in the url - if (Backbone.history.getFragment() === '') { + if (this.isMapRoute(Backbone.history.getFragment())) { startPageConfig = _.find(options.pagesConfig, function(pageConfig) { return pageConfig.start_page === true; }); @@ -110,6 +110,16 @@ var Shareabouts = Shareabouts || {}; showList: function() { this.appView.showListView(); + }, + + isMapRoute: function(fragment) { + // This is a little hacky. I attempted to use Backbone.history.handlers, + // but there is currently no way to map the route, at this point + // transformed into a regex, back to the route name. This may change + // in the future. + return (fragment === '' || (fragment.indexOf('place') === -1 && + fragment.indexOf('page') === -1 && + fragment.indexOf('list') === -1)); } }); diff --git a/src/sa_web/static/js/views/app-view.js b/src/sa_web/static/js/views/app-view.js index 436805d82..53030302e 100644 --- a/src/sa_web/static/js/views/app-view.js +++ b/src/sa_web/static/js/views/app-view.js @@ -407,11 +407,6 @@ var Shareabouts = Shareabouts || {}; _.defer(function() { self.mapView.map.setView(ll, parseInt(zoom, 10)); }); - } else { - // If not, set it to the current map location but don't trigger the route - zoom = this.mapView.map.getZoom(); - ll = this.mapView.map.getCenter(); - this.setLocationRoute(zoom, ll.lat, ll.lng); } this.hidePanel();