The autocomplete throbber is visible even if there is no search. It is because of the padding given to text fields.

Attached is the screenshot.

What is the best way to fix it? In the sub-theme css or in the theme itself?

select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
    border-radius: 4px 4px 4px 4px;
    color: #555555;
    display: inline-block;
    font-size: 14px;
    height: 20px;
    line-height: 20px;
    margin-bottom: 10px;
    padding: 4px 6px;
    vertical-align: middle;
}

Comments

Sinan Erdem’s picture

StatusFileSize
new1.97 KB

Forgot to add the screenshot. Attaching here...

markhalliwell’s picture

Version: 7.x-2.0-beta3 » 7.x-3.x-dev

Moving this to 3.x. I'd actually like to remove core's throbber and incorporate the new .glyphicon-refresh icon with css3 animation here.

kslonka’s picture

Mark: Where (and how) would you like the element inserted? (input group?)

More info:

Class responsible for throbber

// override Throbber
.ui-autocomplete-input {
}

it should be in overrides.less

el7cosmos’s picture

Status: Active » Needs review
StatusFileSize
new12.92 KB

How about this? Could be better approach, im not really into javascript and accessibility.

Css animation taken from font awesome.

markhalliwell’s picture

Status: Needs review » Needs work

@el7cosmos, wow! This is awesome! Just one minor suggestion (to make it a little more aesthetically pleasing):

#autocomplete {
  .glyphicon {
    font-size: 120%;
    margin: -.25em 0;
    height: 1.15em;
    top: 2px;
    &.glyphicon-spin {
      color: @brand-primary;
    }
  }
}
markhalliwell’s picture

+++ b/includes/form.inc
@@ -342,6 +342,36 @@ function bootstrap_preprocess_button(&$vars) {
+    drupal_add_js(drupal_get_path('theme', 'bootstrap') . '/js/bootstrap_autocomplete.js');
...
diff --git a/js/bootstrap_autocomplete.js b/js/bootstrap_autocomplete.js

--- /dev/null
+++ b/js/bootstrap_autocomplete.js

Let's name this bootstrap.autocomplete.js. I still need to rename the other files.

Also, if you could maybe style the dropdown a little better too (to be more "bootstrap" like) that would be awesome. We can create another issue for that if you want though.

markhalliwell’s picture

Grr, nevermind #autocomplete in #5, I misunderstood the hierarchy. We should insert a class for the textfield element's wrapper (where .form-type-textfield is when autocomplete is detected. Something like: .form-autocomplete maybe? Idk. That selector would help us style the glyphicon. Also the initial color of the icon should be: @gray-light. As far as the dropdown styling goes, could we inject some bootstrap panel classes? That seems like it might be an easier way to style it quickly I think. Just a thought.

el7cosmos’s picture

StatusFileSize
new13.66 KB

Like this?

el7cosmos’s picture

Status: Needs work » Needs review

diff to previous patch

diff --git a/bootstrap_subtheme/less/overrides.less b/bootstrap_subtheme/less/overrides.less
index d1f83b2..bc2fcc5 100644
--- a/bootstrap_subtheme/less/overrides.less
+++ b/bootstrap_subtheme/less/overrides.less
@@ -303,6 +303,18 @@ div.password-suggestions ul {
 }
 
 // Autocomplete and throbber
+.form-autocomplete {
+  .glyphicon {
+    font-size: 120%;
+    margin: -.25em 0;
+    height: 1.15em;
+    top: 2px;
+    &.glyphicon-spin {
+      color: @gray-light;
+    }
+  }
+}
+
 #autocomplete li.selected {
   color: @dropdown-link-hover-color;
   background: @dropdown-link-hover-bg;
diff --git a/includes/form.inc b/includes/form.inc
index 6a8a298..b2dc57f 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -100,6 +100,9 @@ function bootstrap_form_element(&$variables) {
   if (!empty($element['#attributes']['disabled'])) {
     $attributes['class'][] = 'form-disabled';
   }
+  if (!empty($element['#autocomplete_path']) && drupal_valid_path($element['#autocomplete_path'])) {
+    $attributes['class'][] = 'form-autocomplete';
+  }
   $attributes['class'][] = 'form-item';
 
   // See http://getbootstrap.com/css/#forms-controls.
markhalliwell’s picture

Status: Needs review » Needs work
+++ b/bootstrap_subtheme/less/overrides.less
@@ -305,3 +301,73 @@ div.password-suggestions ul {
+.form-autocomplete {
+  .glyphicon {
+    font-size: 120%;
+    margin: -.25em 0;
+    height: 1.15em;
+    top: 2px;
+    &.glyphicon-spin {
+      color: @gray-light;
+    }
+  }
+}

@gray-light should be the default and then make the spin @brand-primary.

el7cosmos’s picture

Status: Needs work » Needs review

Whats with dropdown? i'll look at it later

el7cosmos’s picture

StatusFileSize
new13.7 KB

Ooops...i think this is what you mean with color

el7cosmos’s picture

StatusFileSize
new13.7 KB

With renamed js file

markhalliwell’s picture

Status: Needs review » Needs work
+++ b/includes/form.inc
@@ -342,6 +345,36 @@ function bootstrap_preprocess_button(&$vars) {
+    drupal_add_js(drupal_get_path('theme', 'bootstrap') . '/js/bootstrap_autocomplete.js');

Missed the rename here.

el7cosmos’s picture

Status: Needs work » Needs review
--- /dev/null
+++ b/js/bootstrap.autocomplete.js

#13

el7cosmos’s picture

StatusFileSize
new13.7 KB

Sorry i missed it

markhalliwell’s picture

StatusFileSize
new5.33 KB

Here's the patch without the compiled CSS (patch in #16 does apply cleanly anymore). We should probably stop putting this in patches and just let maintainers act as a gatekeeper to compile them.

markhalliwell’s picture

Status: Needs review » Fixed

Thanks @el7cosmos!

Committed 9348d72 to 7.x-3.x.

markhalliwell’s picture

el7cosmos’s picture

uh, sorry for compiled css, my bad

thanks @mark

markhalliwell’s picture

Version: 7.x-3.x-dev » 7.x-3.0-rc1

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

latuminggi’s picture

Status: Closed (fixed) » Needs review

-

Status: Needs review » Needs work

The last submitted patch, 17: bootstrap-throbber-broken-2021805-17.patch, failed testing.

markhalliwell’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)