|
@@ -276,6 +276,23 @@ define([
|
|
|
|
|
|
Select2.prototype._registerEvents = function () {
|
|
|
var self = this;
|
|
|
+
|
|
|
+ this.on('focus', function () {
|
|
|
+ self.$container.addClass('select2-container--focus');
|
|
|
+
|
|
|
+ if (!self.$container.hasClass('select2-container--disabled') &&
|
|
|
+ !self.isOpen()) {
|
|
|
+ if (self.options.get('multiple')) {
|
|
|
+ window.setTimeout(function () {
|
|
|
+ self.open();
|
|
|
+ },
|
|
|
+ self.options.get('ajax') ? 300 : 100);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.open();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
this.on('open', function () {
|
|
|
self.$container.addClass('select2-container--open');
|