Commit:    982d35f1f07ad59bae3c9ecfc400089ccbae49df
Author:    Hannes Magnusson <[email protected]>         Sat, 1 Jan 2011 15:41:43 
+0000
Parents:   372c64f16c7770ab0b75ccec3c69c53cf4765449
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=982d35f1f07ad59bae3c9ecfc400089ccbae49df

Log:
Optimize out useless function call in category header resolving (still 
commented out though)
Only display 20 results, more then that is quite useless

Changed paths:
  M  js/common.js


Diff:
diff --git a/js/common.js b/js/common.js
index 353b088..a19386a 100644
--- a/js/common.js
+++ b/js/common.js
@@ -40,14 +40,14 @@ $(document).ready(function() {
         });
         $.widget("custom.catcomplete", $.ui.autocomplete, {
             /*
-             * Print out category headers rather then in () after the match
+             // Print out category headers rather then in () after the match
             _renderMenu: function(ul, items) {
                 var self = this, currentCategory = "";
                 $.each(items, function(index, item) {
-                    var cat = self._resolveIndexName(item.category);
-                    if (cat != currentCategory) {
+                    if (item.category != currentCategory) {
+                        var cat = self._resolveIndexName(item.category);
                         ul.append("<li class='ui-autocomplete-category'>" + 
cat + "</li>");
-                        currentCategory = cat;
+                        currentCategory = item.category;
                     }
 
                     self._renderItem(ul, item);
@@ -80,7 +80,7 @@ $(document).ready(function() {
         $('#headsearch-keywords').catcomplete({
             delay:      50,
             minScore:   50,
-            maxResults: 50,
+            maxResults: 20,
             source: function(request, response){
                 var term  = request.term;
                 var minScore = this.options.minScore;


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to