From ab03b77ea3d3f4e391c6fed8d6f477a27a60c2e1 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Mon, 13 Apr 2015 21:47:48 -0300 Subject: [PATCH] adding preventDefault for event --- js/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index f3278f2..2bc73d1 100644 --- a/js/main.js +++ b/js/main.js @@ -16,8 +16,8 @@ var noosferoAPI = 'http://www.participa.br/api/v1/articles?private_token=9350c14 $.getJSON(noosferoAPI) .done(function( data ) { resultsPlaceholder.innerHTML = template(data); - $( 'a' ).click(function(){ - var item = this.href.split('#').pop(); + $( 'a' ).click(function(event){ + var item = this.href.split('#').pop(); if(item == 'proposal-categories'){ $('#proposal-group').hide(); $('#nav-proposal-categories a').addClass('active'); @@ -32,6 +32,7 @@ $.getJSON(noosferoAPI) } $('.proposal-detail').hide(); $('#' + item).show(); + event.preventDefault(); }); }) .fail(function( jqxhr, textStatus, error ) { -- libgit2 0.21.2