Browse Source

Evolution #54: js: liste de tags chargé qu'une fois

bastien 12 years ago
parent
commit
48acd9a232
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/Muzich/CoreBundle/Resources/views/Tag/tagsPrompt.html.twig

+ 5 - 2
src/Muzich/CoreBundle/Resources/views/Tag/tagsPrompt.html.twig View File

@@ -7,8 +7,11 @@
7 7
 
8 8
 <script language="javascript" type="text/javascript">
9 9
 
10
-  var taglist = new Array({{ tags|length }});
11
-  {% for i, tag in tags %}taglist[{{ i }}] = "{{ tag }}"; {% endfor %}
10
+  if (typeof(taglist) == 'undefined')
11
+  {
12
+    taglist = new Array({{ tags|length }});
13
+    {% for i, tag in tags %}taglist[{{ i }}] = "{{ tag }}"; {% endfor %}
14
+  }
12 15
   
13 16
   var taginit = new Array();
14 17
   {% if search_tags is defined %}