Skip to content

Instantly share code, notes, and snippets.

@colemanw
Created October 24, 2015 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colemanw/bc6ca673a359730fe9bd to your computer and use it in GitHub Desktop.
Save colemanw/bc6ca673a359730fe9bd to your computer and use it in GitHub Desktop.
diff --git a/js/Common.js b/js/Common.js
index 6fa4589..a882280 100644
--- a/js/Common.js
+++ b/js/Common.js
@@ -409,6 +409,15 @@ if (!CRM.vars) CRM.vars = {};
if (settings.ajax) {
$el.addClass('crm-ajax-select');
}
+
+ if (settings.placeholder || settings.placeholderOption || $el.data('placeholder') || $el.a
+ $el.on('select2-open', function() {
+ if (!$(this).val()) {
+ $('.select2-highlighted', '#select2-drop').removeClass('select2-highlighted');
+ }
+ })
+ }
+
$el.select2(settings);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment