Make WordPress Core

Ticket #22975: 22975.suggest.patch

File 22975.suggest.patch, 1.2 KB (added by ocean90, 10 years ago)
  • wp-includes/js/jquery/suggest.js

     
    1818                var $input, $results, timeout, prevLength, cache, cacheSize;
    1919
    2020                $input = $(input).attr("autocomplete", "off");
    21                 $results = $(document.createElement("ul"));
     21                $results = $("<ul/>");
    2222
    2323                timeout = false;                // hold timeout ID for suggestion results to appear
    2424                prevLength = 0;                 // last recorded length of $input.val()
     
    3737                        setTimeout(function() { $results.hide() }, 200);
    3838                });
    3939
     40                $input.keydown(processKey);
    4041
    41                 // help IE users if possible
    42                 if ( $.browser.msie ) {
    43                         try {
    44                                 $results.bgiframe();
    45                         } catch(e) { }
    46                 }
    47 
    48                 // I really hate browser detection, but I don't see any other way
    49                 if ($.browser.mozilla)
    50                         $input.keypress(processKey);    // onkeypress repeats arrow keys in Mozilla/Opera
    51                 else
    52                         $input.keydown(processKey);             // onkeydown repeats arrow keys in IE/Safari
    53 
    54 
    55 
    56 
    5742                function resetPosition() {
    5843                        // requires jquery.dimension plugin
    5944                        var offset = $input.offset();
     
    327312
    328313        };
    329314
    330 })(jQuery);
    331  No newline at end of file
     315})(jQuery);