Commit a0960f44f322171363cb45f57dd0b39b3b409c4a

Authored by Victor Costa
1 parent e26f5ac9

Fix requirement of login with participate button

Showing 2 changed files with 3 additions and 6 deletions   Show diff stats
@@ -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">
@@ -807,15 +807,12 @@ define([&#39;jquery&#39;, &#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;, &#39;piwik&#39;], fun @@ -807,15 +807,12 @@ define([&#39;jquery&#39;, &#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;, &#39;piwik&#39;], 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 });