X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=templates%2Fprofile%2Fdeco.tpl;h=b4eb62bc6dd36d385e6e36e74b291d607c433052;hb=be6ab042d1dc34d9e42557281b48dd8da400231b;hp=935ce490c641c5ac67b11eef5984c38f8f39cdf2;hpb=85cc366b075d06f805c16ac3df82acabdedcef3d;p=platal.git diff --git a/templates/profile/deco.tpl b/templates/profile/deco.tpl index 935ce49..b4eb62b 100644 --- a/templates/profile/deco.tpl +++ b/templates/profile/deco.tpl @@ -60,16 +60,27 @@ function buildGrade(id, current) } } +function makeAddProcess(id) +{ + return function(data) + { + $('#medals').after(data); + update(); + getMedalName(id); + buildGrade(id, 0); + }; +} + function add() { var id = document.forms.prof_annu['medal_sel'].value; - $.get(platal_baseurl + 'profile/ajax/medal/' + id, - function(data) { $('#medals').after(data); update(); }); + $.get(platal_baseurl + 'profile/ajax/medal/' + id, makeAddProcess(id)); } function remove(id) { $("#medal_" + id).remove(); + update(); } {/literal} @@ -84,7 +95,7 @@ function remove(id) {/foreach} {/if}{/foreach} {/foreach} - +//]]>