diff --git a/index.html b/index.html index b7fa577..52b12fd 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,8 @@ {{#each categories}}
  • {{#link name id}}{{/link}} - + {{#each ../../article.children}} {{/each}} diff --git a/js/main.js b/js/main.js index 54480d9..6976074 100644 --- a/js/main.js +++ b/js/main.js @@ -60,20 +60,7 @@ $.getJSON(noosferoAPI) }); $( '.proposal-item a' ).click(function(event){ var item = this.href.split('#').pop(); - //Display Proposal - $('#proposal-categories').hide(); - $('#proposal-group').hide(); - $('nav').hide(); - $('#content').hide(); - $('.proposal-detail').hide(); - $('#' + item).show(); - - $('.send-proposal-button').show(); - $('.make-proposal-form').hide(); - $('.login-container').hide(); - - var topic_id = this.id.replace('\#',''); - loadRandomProposal(topic_id, private_token); + display_proposal(item); }); $( '.proposal-category a' ).click(function(event){ var item = this.href.split('#').pop(); @@ -104,7 +91,9 @@ $.getJSON(noosferoAPI) $('.body').toggle(); event.preventDefault(); }); - + $( '.proposal-selection' ).change(function(event){ + display_proposal('proposal-item-' + this.value); + }); $('.save-article-form').submit(function (e) { e.preventDefault(); @@ -214,3 +203,22 @@ function guid() { return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); } + + + +function display_proposal(item){ + //Display Proposal + $('#proposal-categories').hide(); + $('#proposal-group').hide(); + $('nav').hide(); + $('#content').hide(); + $('.proposal-detail').hide(); + $('#' + item).show(); + + $('.send-proposal-button').show(); + $('.make-proposal-form').hide(); + $('.login-container').hide(); + + var topic_id = this.id.replace('\#',''); + loadRandomProposal(topic_id, private_token); +} -- libgit2 0.21.2