1
0
mirror of synced 2025-02-10 17:19:23 +03:00

Finished switching main container to BEM

This commit is contained in:
Kevin Brown 2014-11-24 18:38:58 -05:00
parent 7933eb77c1
commit 8cb074ccef
13 changed files with 39 additions and 34 deletions

View File

@ -60,7 +60,7 @@
-webkit-user-select: none; } -webkit-user-select: none; }
.select2-container .dropdown .results .options .option[aria-selected] { .select2-container .dropdown .results .options .option[aria-selected] {
cursor: pointer; } cursor: pointer; }
.select2-container.open .dropdown { .select2-container.select2-container--open .dropdown {
border-top: none; border-top: none;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
@ -112,7 +112,7 @@
margin-right: 2px; } margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover { .select2-container--default .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover {
color: #333; } color: #333; }
.select2-container--default.open .select2-selection--single, .select2-container--default.open .select2-selection--multiple { .select2-container--default.select2-container--open .select2-selection--single, .select2-container--default.select2-container--open .select2-selection--multiple {
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; } border-bottom-right-radius: 0; }
.select2-container--default .select2-search--dropdown .select2-search__field { .select2-container--default .select2-search--dropdown .select2-search__field {

File diff suppressed because one or more lines are too long

View File

@ -672,7 +672,7 @@ define('select2/selection/base',[
var $select = $target.closest('.select2'); var $select = $target.closest('.select2');
var $all = $('.select2.open'); var $all = $('.select2.select2-container--open');
$all.each(function () { $all.each(function () {
var $this = $(this); var $this = $(this);
@ -839,7 +839,8 @@ define('select2/selection/multiple',[
}); });
}); });
this.$selection.on('click', '.remove', function (evt) { this.$selection.on('click', '.select2-selection__choice__remove',
function (evt) {
var $remove = $(this); var $remove = $(this);
var $selection = $remove.parent(); var $selection = $remove.parent();
@ -3258,11 +3259,11 @@ define('select2/core',[
var self = this; var self = this;
this.on('open', function () { this.on('open', function () {
self.$container.addClass('open'); self.$container.addClass('select2-container--open');
}); });
this.on('close', function () { this.on('close', function () {
self.$container.removeClass('open'); self.$container.removeClass('select2-container--open');
}); });
this.on('query', function (params) { this.on('query', function (params) {
@ -3341,7 +3342,7 @@ define('select2/core',[
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
return this.$container.hasClass('open'); return this.$container.hasClass('select2-container--open');
}; };
Select2.prototype.destroy = function () { Select2.prototype.destroy = function () {

View File

@ -672,7 +672,7 @@ define('select2/selection/base',[
var $select = $target.closest('.select2'); var $select = $target.closest('.select2');
var $all = $('.select2.open'); var $all = $('.select2.select2-container--open');
$all.each(function () { $all.each(function () {
var $this = $(this); var $this = $(this);
@ -839,7 +839,8 @@ define('select2/selection/multiple',[
}); });
}); });
this.$selection.on('click', '.remove', function (evt) { this.$selection.on('click', '.select2-selection__choice__remove',
function (evt) {
var $remove = $(this); var $remove = $(this);
var $selection = $remove.parent(); var $selection = $remove.parent();
@ -3258,11 +3259,11 @@ define('select2/core',[
var self = this; var self = this;
this.on('open', function () { this.on('open', function () {
self.$container.addClass('open'); self.$container.addClass('select2-container--open');
}); });
this.on('close', function () { this.on('close', function () {
self.$container.removeClass('open'); self.$container.removeClass('select2-container--open');
}); });
this.on('query', function (params) { this.on('query', function (params) {
@ -3341,7 +3342,7 @@ define('select2/core',[
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
return this.$container.hasClass('open'); return this.$container.hasClass('select2-container--open');
}; };
Select2.prototype.destroy = function () { Select2.prototype.destroy = function () {

View File

@ -10207,7 +10207,7 @@ define('select2/selection/base',[
var $select = $target.closest('.select2'); var $select = $target.closest('.select2');
var $all = $('.select2.open'); var $all = $('.select2.select2-container--open');
$all.each(function () { $all.each(function () {
var $this = $(this); var $this = $(this);
@ -10374,7 +10374,8 @@ define('select2/selection/multiple',[
}); });
}); });
this.$selection.on('click', '.remove', function (evt) { this.$selection.on('click', '.select2-selection__choice__remove',
function (evt) {
var $remove = $(this); var $remove = $(this);
var $selection = $remove.parent(); var $selection = $remove.parent();
@ -12793,11 +12794,11 @@ define('select2/core',[
var self = this; var self = this;
this.on('open', function () { this.on('open', function () {
self.$container.addClass('open'); self.$container.addClass('select2-container--open');
}); });
this.on('close', function () { this.on('close', function () {
self.$container.removeClass('open'); self.$container.removeClass('select2-container--open');
}); });
this.on('query', function (params) { this.on('query', function (params) {
@ -12876,7 +12877,7 @@ define('select2/core',[
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
return this.$container.hasClass('open'); return this.$container.hasClass('select2-container--open');
}; };
Select2.prototype.destroy = function () { Select2.prototype.destroy = function () {

File diff suppressed because one or more lines are too long

11
dist/js/select2.js vendored
View File

@ -1100,7 +1100,7 @@ define('select2/selection/base',[
var $select = $target.closest('.select2'); var $select = $target.closest('.select2');
var $all = $('.select2.open'); var $all = $('.select2.select2-container--open');
$all.each(function () { $all.each(function () {
var $this = $(this); var $this = $(this);
@ -1267,7 +1267,8 @@ define('select2/selection/multiple',[
}); });
}); });
this.$selection.on('click', '.remove', function (evt) { this.$selection.on('click', '.select2-selection__choice__remove',
function (evt) {
var $remove = $(this); var $remove = $(this);
var $selection = $remove.parent(); var $selection = $remove.parent();
@ -3686,11 +3687,11 @@ define('select2/core',[
var self = this; var self = this;
this.on('open', function () { this.on('open', function () {
self.$container.addClass('open'); self.$container.addClass('select2-container--open');
}); });
this.on('close', function () { this.on('close', function () {
self.$container.removeClass('open'); self.$container.removeClass('select2-container--open');
}); });
this.on('query', function (params) { this.on('query', function (params) {
@ -3769,7 +3770,7 @@ define('select2/core',[
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
return this.$container.hasClass('open'); return this.$container.hasClass('select2-container--open');
}; };
Select2.prototype.destroy = function () { Select2.prototype.destroy = function () {

File diff suppressed because one or more lines are too long

View File

@ -231,11 +231,11 @@ define([
var self = this; var self = this;
this.on('open', function () { this.on('open', function () {
self.$container.addClass('open'); self.$container.addClass('select2-container--open');
}); });
this.on('close', function () { this.on('close', function () {
self.$container.removeClass('open'); self.$container.removeClass('select2-container--open');
}); });
this.on('query', function (params) { this.on('query', function (params) {
@ -314,7 +314,7 @@ define([
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
return this.$container.hasClass('open'); return this.$container.hasClass('select2-container--open');
}; };
Select2.prototype.destroy = function () { Select2.prototype.destroy = function () {

View File

@ -48,7 +48,7 @@ define([
var $select = $target.closest('.select2'); var $select = $target.closest('.select2');
var $all = $('.select2.open'); var $all = $('.select2.select2-container--open');
$all.each(function () { $all.each(function () {
var $this = $(this); var $this = $(this);

View File

@ -35,7 +35,8 @@ define([
}); });
}); });
this.$selection.on('click', '.remove', function (evt) { this.$selection.on('click', '.select2-selection__choice__remove',
function (evt) {
var $remove = $(this); var $remove = $(this);
var $selection = $remove.parent(); var $selection = $remove.parent();

View File

@ -38,7 +38,7 @@
} }
} }
&.open .dropdown { &.select2-container--open .dropdown {
border-top: none; border-top: none;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;

View File

@ -63,7 +63,7 @@
} }
} }
&.open { &.select2-container--open {
.select2-selection--single, .select2-selection--multiple { .select2-selection--single, .select2-selection--multiple {
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;