diff --git a/.gitignore b/.gitignore index 416d852..b8ac1cd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,6 @@ coverage.html .settings doc public/css/ +static/css/ *.swp .env diff --git a/static/js/events/map/forms.js b/static/js/events/map/forms.js index 0098f56..9c4fb66 100644 --- a/static/js/events/map/forms.js +++ b/static/js/events/map/forms.js @@ -130,6 +130,30 @@ function ($, EventModel, forms) { return function (mapMaker) { ev.preventDefault(); toggleCreateForm(); }); + navigator.idSSO.watch( { + onlogin: function( assert ){ + var $button = $('.loggedout-expand-form-button') + .removeClass('loggedout-expand-form-button') + .addClass('expand-form-button') + .click(function(ev) { + ev.preventDefault(); + toggleCreateForm(); + }); + $('.event-button-text', $button).text('Add an Event'); + if( document.referrer.indexOf( 'login' ) !== -1 ){ + toggleCreateForm(); + $( '#event_title' ).focus(); + } + }, + onlogout: function(){ + var $button = $('.expand-form-button') + .addClass('loggedout-expand-form-button') + .removeClass('expand-form-button') + .unbind('click'); + $('.event-button-text', $button).text('Log in to add an Event'); + } + } ); + EventModel.all(function (events) { mapMaker.dropPins(events) }); }}); diff --git a/static/js/events/map/map_maker.js b/static/js/events/map/map_maker.js index c0dc60e..173cb3a 100644 --- a/static/js/events/map/map_maker.js +++ b/static/js/events/map/map_maker.js @@ -21,7 +21,6 @@ function ($, google, InfoBubble, OverlappingMarkerSpiderfier, MarkerClusterer) { var seen = {}; var clusters = []; var ID = '__gm_id'; - self.oms.unspiderfy(); markers.forEach(function (m) { if (m[ID] in seen) return; self.oms.markersNearMarker(m).forEach(function (nm) { diff --git a/views/events/map.html b/views/events/map.html index cb2ca51..d5becfd 100644 --- a/views/events/map.html +++ b/views/events/map.html @@ -26,9 +26,9 @@
- + - Add an Event + Log in to add an Event Event Guides