Browse Source

Evolution #53: Recherche js tags: pas que le début

bastien 13 years ago
parent
commit
646199ac96
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Muzich/CoreBundle/Resources/views/Tag/tagsPrompt.html.twig

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

34
   // to highlight part of the matched string
34
   // to highlight part of the matched string
35
   $.ui.autocomplete.prototype._renderItem = function( ul, item) {
35
   $.ui.autocomplete.prototype._renderItem = function( ul, item) {
36
       var sstr = $.trim(this.term);
36
       var sstr = $.trim(this.term);
37
-      var re = new RegExp("^" + sstr, "i") ;
37
+      var re = new RegExp(sstr, "i") ;
38
       var t = item.label.replace(re,"<strong>" + sstr + "</strong>");
38
       var t = item.label.replace(re,"<strong>" + sstr + "</strong>");
39
       return $( "<li></li>" )
39
       return $( "<li></li>" )
40
           .data( "item.autocomplete", item )
40
           .data( "item.autocomplete", item )
47
       source: function(req, responseFn) {
47
       source: function(req, responseFn) {
48
           var sstr = $.trim(req.term);
48
           var sstr = $.trim(req.term);
49
           var re = $.ui.autocomplete.escapeRegex(sstr);
49
           var re = $.ui.autocomplete.escapeRegex(sstr);
50
-          var matcher = new RegExp( "^" + re, "i" );
50
+          var matcher = new RegExp(re, "i" );
51
           var a = $.grep( taglist, function(item,index){
51
           var a = $.grep( taglist, function(item,index){
52
               return matcher.test(item);
52
               return matcher.test(item);
53
           });
53
           });