Skip to content

Instantly share code, notes, and snippets.

@colepacak
Created September 7, 2016 16:24
Show Gist options
  • Save colepacak/b4f6e466c0efd6716795e0f97b6159a5 to your computer and use it in GitHub Desktop.
Save colepacak/b4f6e466c0efd6716795e0f97b6159a5 to your computer and use it in GitHub Desktop.
Chosen Ajax - Override theme textfield
diff --git a/chosen_ajax.module b/chosen_ajax.module
index 5b2f460..ff7a7d9 100644
--- a/chosen_ajax.module
+++ b/chosen_ajax.module
@@ -146,7 +146,14 @@ function chosen_ajax_theme_registry_alter(&$theme_registry) {
function chosen_ajax_theme_textfield($variables) {
$element = $variables['element'];
if (!isset($element['#chosen_ajax'])) {
- return theme_textfield($variables);
+ if (
+ isset($element['#attributes']['data-type']) &&
+ $element['#attributes']['data-type'] === 'number'
+ ) {
+ return aact_membership_process_textfield($variables);
+ } else {
+ return theme_textfield($variables);
+ }
}
$element = $variables['element'];
element_set_attributes($element, array('id', 'name', 'size'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment