Commit a0960f44f322171363cb45f57dd0b39b3b409c4a
1 parent
e26f5ac9
Exists in
master
and in
5 other branches
Fix requirement of login with participate button
Showing
2 changed files
with
3 additions
and
6 deletions
Show diff stats
index.html
| @@ -510,7 +510,7 @@ | @@ -510,7 +510,7 @@ | ||
| 510 | <div class="row"> | 510 | <div class="row"> |
| 511 | <div class="col-sm-4 col-md-3 col-lg-2"> | 511 | <div class="col-sm-4 col-md-3 col-lg-2"> |
| 512 | <div class="row"> | 512 | <div class="row"> |
| 513 | - <button id="talk__button-participate" type="button" class="button button-block" data-event-id="{{event.id}}">Participar</button> | 513 | + <button id="talk__button-participate" type="button" class="button button-block require-main-login" data-event-id="{{event.id}}">Participar</button> |
| 514 | </div> | 514 | </div> |
| 515 | </div> | 515 | </div> |
| 516 | <div class="col-sm-8 col-md-9 col-lg-10"> | 516 | <div class="col-sm-8 col-md-9 col-lg-10"> |
js/main.js
| @@ -807,15 +807,12 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -807,15 +807,12 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 807 | // handle click on elsewhere (out of loginPanel) | 807 | // handle click on elsewhere (out of loginPanel) |
| 808 | $(document).click(function(e){ | 808 | $(document).click(function(e){ |
| 809 | var $target = $(e.target); | 809 | var $target = $(e.target); |
| 810 | - // console.log('e.target', e.target); | ||
| 811 | 810 | ||
| 812 | var isLoginButton = ($target.attr('id') === 'login-button'); | 811 | var isLoginButton = ($target.attr('id') === 'login-button'); |
| 813 | - // console.log('isLoginButton', isLoginButton); | ||
| 814 | - | 812 | + var requireLogin = $target.hasClass('require-main-login'); |
| 815 | var isChildOfPanel = ($target.closest(loginPanelId).length !== 0); | 813 | var isChildOfPanel = ($target.closest(loginPanelId).length !== 0); |
| 816 | - // console.log('isChildOfPanel', isChildOfPanel); | ||
| 817 | 814 | ||
| 818 | - if( !isLoginButton && !isChildOfPanel ){ | 815 | + if( !isLoginButton && !isChildOfPanel && !requireLogin ){ |
| 819 | $loginPanel.hide(); | 816 | $loginPanel.hide(); |
| 820 | } | 817 | } |
| 821 | }); | 818 | }); |