From afd353788b69a6b2bc34d43d9bf3e061cf7fff9d Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 16 Aug 2012 22:54:14 -0700 Subject: [PATCH] allow opts.dropdownCss to override css even after position. fixes #328 --- select2.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/select2.js b/select2.js index 6e8d2df4..12a015a6 100755 --- a/select2.js +++ b/select2.js @@ -359,7 +359,7 @@ query.callback({results: data}); return; } - + process = function(datum, collection) { var group; datum = datum[0]; @@ -375,7 +375,7 @@ } } }; - + $(data).each2(function(i, datum) { process(datum, filtered.results); }); query.callback(filtered); }; @@ -967,8 +967,6 @@ if (this.search.val() === " ") { this.search.val(""); } - this.dropdown.css(evaluate(this.opts.dropdownCss)); - this.dropdown.addClass("select2-drop-active"); this.container.addClass("select2-dropdown-open").addClass("select2-container-active"); this.updateResults(true); @@ -978,9 +976,12 @@ } this.dropdown.show(); - this.ensureHighlightVisible(); this.positionDropdown(); + this.dropdown.css(evaluate(this.opts.dropdownCss)); + this.dropdown.addClass("select2-drop-active"); + + this.ensureHighlightVisible(); this.focusSearch(); },