diff --git a/core/misc/autocomplete.js b/core/misc/autocomplete.js index d272c6c..981be06 100644 --- a/core/misc/autocomplete.js +++ b/core/misc/autocomplete.js @@ -22,6 +22,28 @@ Drupal.behaviors.autocomplete = { .append($('') .attr('id', $input[0].id + '-autocomplete-aria-live') ); + + var $inputHeight = $input.innerHeight(); + // Get hidden element inner height. + if ($inputHeight == 0) { + var copiedElement = $input.clone() + .attr("id", false) + .css({visibility:"hidden", display:"block", position:"absolute"}); + + $("body").append(copiedElement); + $inputHeight = copiedElement.innerHeight(); + copiedElement.remove(); + } + // Calculated background posotion. + var $PosX = ($('html').attr('dir') == 'rtl') ? '1% ' : '100% '; + var $inputBgPos = $PosX + ($inputHeight / 2 - 6.5) + 'px'; + var $inputBgPosHover = $PosX + ($inputHeight / 2 - 137) + 'px'; + + // Store inner height into DOM. + jQuery.data(document.body, $input[0].id + 'innerHeight', {inputBgPos: $inputBgPos, inputBgPosHover: $inputBgPosHover}); + + $input.css('background-position', $inputBgPos); + new Drupal.jsAC($input, acdb[uri]); }); } @@ -249,15 +271,18 @@ Drupal.jsAC.prototype.found = function (matches) { }; Drupal.jsAC.prototype.setStatus = function (status) { + var $innerHeight = jQuery.data(document.body, $(this.input)[0].id + 'innerHeight'); switch (status) { case 'begin': - $(this.input).addClass('throbbing'); + $(this.input).addClass('throbbing') + .css('background-position', $innerHeight.inputBgPosHover); $(this.ariaLive).html(Drupal.t('Searching for matches...')); break; case 'cancel': case 'error': case 'found': - $(this.input).removeClass('throbbing'); + $(this.input).removeClass('throbbing') + .css('background-position', $innerHeight.inputBgPos); break; } }; diff --git a/core/misc/throbber.gif b/core/misc/throbber.gif index 4352e64..1455394 100644 --- a/core/misc/throbber.gif +++ b/core/misc/throbber.gif @@ -1,11 +1,13 @@ -GIF89a(s {{5FZk؋ᵵス! NETSCAPE2.0!,( Yۨ/[4PenBQ1(+"($Q pBWS%r"ͦn> LJ'{v~  {+*  #   " "  *++ !!, G Ӓڨ"7^G!qD0*O"`p.LisJX 5rLd,3uY G+i!, ? Xc*pʭM89#: %H(UȭVa'FӘHcZV^(!, H T(P -"HŨM p8ȄqJhD1rwMgta!I, -!, I Ӓڨ"7^Xl~# z'&Hxjc"S9 -3yzyS`pZ!, @ Xc*pPܺ.xD -!*J@0J ]xJc:Q:y!, E (P -"Xw"Gb"LQ%I U&&.8 CNQ!, F ڨ"7^Xl~# WP[,'rB` bC1A+!, A Xc*pPܺ.xTP#I0PǮE`ul11(0< -!, I T(P -"H7h @<0PS`) -NBbph&QaիS3D!, H Ӓڨ"7^Xc̊W8N ՊS ,] `Uo -!, A Xc*pȭA,"q#9P@#+cUV\RDVw +GIF89asֽFkؠ狿5Z {{Ƶ! NETSCAPE2.0! XMP DataXMP ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!  + !, 'rFCPèrCoC ἅFnB10k+Ύ""QqBWS%r"n> LJ'{v~ + {+*  +#  +" + "8$Oo*~:RpEj!, G 'rp֨"6"<#>*`*pLi"JXp5Hd,QE0uY櫍G+i!, ? 'rc*wNJ H(q(\^E Ua(Ճɭ.c'FӘbZV^(!, H 'r(VĦŨ Hs\Hmsb(Dm XrwrM f`)I, +!, I 'rp֨"6"""p*J P +"+#V\RDVw ; \ No newline at end of file