Oops, fix medals with Safari
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 2 Sep 2007 20:59:19 +0000 (22:59 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 2 Sep 2007 20:59:19 +0000 (22:59 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
templates/profile/deco.medal.tpl
templates/profile/deco.tpl

index 20dcab6..280d256 100644 (file)
     <div id="medal_grade_{$id}"><input type="hidden" name="medals[{$id}][valid]" value="{$medal.valid}" /></div>
   </div>
   <a href="javascript:remove({$id})" style="vertical-align: middle">{icon name="cross" title="Supprimer cette médaille"}</a>
+  {if !$ajaxdeco}
   <script type="text/javascript">
   getMedalName({$id});
   buildGrade({$id}, {$medal.grade});
   </script>
+  {/if}
 </div>
 
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 935ce49..87ca768 100644 (file)
@@ -60,11 +60,21 @@ 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)