From 13e18eaf0989b5d89fd736f7a97dd9e6ae1aa902 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Mon, 4 May 2015 08:24:34 -0300 Subject: [PATCH] removing double call in proposal detail view --- js/main.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/js/main.js b/js/main.js index 5a6c95a..cf4786a 100644 --- a/js/main.js +++ b/js/main.js @@ -372,6 +372,7 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ $('.results-container').hide(); $('.experience-proposal-container').hide(); $('.talk-proposal-container').hide(); + $('#proposal-item-' + proposal_id + '.proposal-detail').show(); $('#proposal-item-' + proposal_id + ' .body').show(); var url = host + '/api/v1/articles/' + proposal_id + '?private_token=' + private_token + '&fields=id,body&content_type=ProposalsDiscussionPlugin::Topic'; @@ -501,17 +502,13 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ $('html, body').animate({ scrollTop: 0 }, 'fast'); }, navigateToProposal: function(proposalId){ + var regexSubpages = /sobre-o-programa$/; if(proposalId === undefined){ this.display_proposals_tab(); - }else{ + }else if(regexSubpages.exec(window.location.hash) == null){ this.display_proposal('proposal-item-' + proposalId); - - // show sub-page - var regexSubpages = /sobre-o-programa$/; - var m; - if((m = regexSubpages.exec(window.location.hash)) !== null ){ - this.display_proposal_detail(proposalId); - } + }else{ + this.display_proposal_detail(proposalId); } }, navigateToCategory: function(categoryId){ -- libgit2 0.21.2