Browse Source

Correction du placeholder de l'input a tags. (il y avait des bugs de message par defaut souvent ...)

Sevajol Bastien 11 years ago
parent
commit
1549b7b55f

+ 3 - 4
src/Muzich/CoreBundle/Resources/views/Tag/tagsPrompt.html.twig View File

@@ -11,9 +11,9 @@
11 11
     {% endif %}
12 12
   {% endif %}
13 13
   
14
-   <input class="tags_prompt_list" name="tags" value=""> 
14
+   <input class="tags_prompt_list" name="tags" value="" /> 
15 15
    <input id="tags_selected_tag_{{ form_name }}" type="hidden" value="" />
16
-   <input class="tag_text_help" type="hidden" value="{{ 'tags.inputtext.help'|trans({}, 'userui') }}"/>
16
+   
17 17
    <div id="search_tag_{{ form_name }}" class="search_tag_list" style="display: none;">
18 18
      <span class="info"></span>
19 19
      <div class="tag_loader_div">
@@ -46,8 +46,7 @@
46 46
   // garde la valeur de l'input)
47 47
   $(document).ready(function(){
48 48
     $('div#tags_prompt_{{ form_name }} ul.tagbox li.input input[type="text"]')
49
-      .val(string_tag_prompt_input_help)
50
-    ;
49
+      .attr('placeholder', "{{ 'tags.inputtext.help'|trans({}, 'userui') }}");
51 50
   });
52 51
   
53 52
   // On détruit la variable taginit

+ 0 - 1
src/Muzich/CoreBundle/Resources/views/layout.html.twig View File

@@ -32,7 +32,6 @@
32 32
     string_follow_stop = "{{ 'user.stop_follow'|trans({}, 'users') }}";
33 33
     string_follow_following = "{{ 'user.following'|trans({}, 'users') }}";
34 34
     string_follow_follow = "{{ 'user.follow'|trans({}, 'users') }}";
35
-    string_tag_prompt_input_help = "{{ 'tags.inputtext.help'|trans({}, 'userui') }}";
36 35
     string_tag_add_title = "{{ 'tags.add.title'|trans({}, 'userui') }}";
37 36
     string_tag_add_text = "{{ 'tags.add.text'|trans({}, 'userui') }}";
38 37
     string_tag_add_argument = "{{ 'tags.add.argument'|trans({}, 'userui') }}";

+ 4 - 9
web/bundles/muzichcore/js/muzich.js View File

@@ -217,9 +217,7 @@ function remove_tags(form_name)
217 217
   //tagsAddeds[form_name] = new Array();
218 218
   $('form[name="'+form_name+'"] ul.tagbox li.tag').remove();
219 219
   $('form[name="'+form_name+'"] input.tagBox_tags_ids').val('');
220
-  $('div#tags_prompt_'+form_name+' ul.tagbox li.input input[type="text"]')
221
-    .val(string_tag_prompt_input_help)
222
-  ;
220
+  
223 221
 }
224 222
 
225 223
 $(document).ready(function(){
@@ -687,7 +685,6 @@ $(document).ready(function(){
687 685
   ////////////////// TAG PROMPT ///////////////
688 686
  
689 687
   var ajax_query_timestamp = null;
690
-  var tag_text_help = $('input.tag_text_help').val();
691 688
  
692 689
   // Les deux clicks ci-dessous permettent de faire disparaitre
693 690
   // la div de tags lorsque l'on clique ailleurs
@@ -706,7 +703,7 @@ $(document).ready(function(){
706 703
   function autocomplete_tag(input, form_name)
707 704
   {
708 705
     // Il doit y avoir au moin un caractère
709
-    if ((input.val().length > 0) && (input.val() != string_tag_prompt_input_help)) 
706
+    if (input.val().length > 0) 
710 707
     {
711 708
 
712 709
       // on met en variable l'input
@@ -808,7 +805,8 @@ $(document).ready(function(){
808 805
                       inputTag.trigger("selectTag");
809 806
                       // On cache la liste puisque le choix vient d'être fait
810 807
                       divtags.hide();
811
-                      inputTag.val(tag_text_help); 
808
+                      // On vide le champs de saisie du tag
809
+                      $('input.form-default-value-processed').val('');
812 810
                       return false;
813 811
                     })
814 812
                     .append(t_string)
@@ -924,7 +922,6 @@ $(document).ready(function(){
924 922
           inputTag.trigger("selectTag");
925 923
           // On cache la liste puisque le choix vient d'être fait
926 924
           divtags.hide();
927
-          inputTag.val(tag_text_help); 
928 925
 
929 926
           link_add_tag.parents('div.search_tag_list').find('img.tag_loader').hide();
930 927
 
@@ -1060,7 +1057,6 @@ $(document).ready(function(){
1060 1057
     return false;
1061 1058
   });
1062 1059
   
1063
-  $('ul.tagbox li.input input[type="text"]').val(tag_text_help);
1064 1060
   $('ul.tagbox li.input input[type="text"]').formDefaults();
1065 1061
  
1066 1062
   ////////////////// FIN TAG PROMPT ///////////////
@@ -1247,7 +1243,6 @@ $(document).ready(function(){
1247 1243
       input_tag.val($(this).text());
1248 1244
       // Et on execute l'évènement selectTag de l'input
1249 1245
       input_tag.trigger("selectTag");
1250
-      input_tag.val(tag_text_help); 
1251 1246
     }
1252 1247
     else
1253 1248
     {

+ 0 - 3
web/js/tags/jquery.tagBox.js View File

@@ -145,9 +145,6 @@
145 145
              
146 146
           }
147 147
           
148
-          $('div#tags_prompt_'+form_name+' ul.tagbox li.input input[type="text"]')
149
-            .val(string_tag_prompt_input_help)
150
-          ;
151 148
         },
152 149
         removeTag : function(index, id, form_name) {
153 150