Merge branch 'profile_edit'
[platal.git] / templates / profile / deco.tpl
index 935ce49..b4eb62b 100644 (file)
@@ -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}
-</script>
+//]]></script>
 
 <table class="bicol">
   <tr>