Merge pull request #10 from daleee/890872-prompt-to-save
[bug 890872] Prompt users to sign in to save events
This commit is contained in:
Коммит
c07184ad46
|
@ -17,5 +17,6 @@ coverage.html
|
|||
.settings
|
||||
doc
|
||||
public/css/
|
||||
static/css/
|
||||
*.swp
|
||||
.env
|
||||
|
|
|
@ -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) });
|
||||
}});
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
</form>
|
||||
|
||||
<div class="overlay-buttons">
|
||||
<a class="header expand-form-button">
|
||||
<a href="/login" class="header loggedout-expand-form-button">
|
||||
<span class="icon-plus"></span>
|
||||
Add an Event
|
||||
<span class="event-button-text">Log in to add an Event</span>
|
||||
</a>
|
||||
<a href="/guides" id="event-guides" class="header">
|
||||
Event Guides
|
||||
|
|
Загрузка…
Ссылка в новой задаче