1
0
mirror of synced 2024-11-21 20:46:07 +03:00

Extracted the original positioning out

With this change, any instances overriding the dropdown is
required to decorate it with the positioning module.
This commit is contained in:
Kevin Brown 2014-11-25 15:59:13 -05:00
parent 6a0c002f94
commit 81db43fa99
10 changed files with 84 additions and 14 deletions

View File

@ -10,7 +10,10 @@ module.exports = function (grunt) {
fullIncludes = [
'jquery',
'select2/compat/matcher'
'select2/compat/matcher',
'select2/dropdown/attachContainer'
].concat(includes);
var i18nModules = [];

View File

@ -2586,8 +2586,7 @@ define('select2/dropdown',[
};
Dropdown.prototype.position = function ($dropdown, $container) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
// Should be implmented in subclasses
};
Dropdown.prototype.destroy = function () {
@ -2961,12 +2960,17 @@ define('select2/defaults',[
'./i18n/en'
], function ($, ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch,
Utils, Translation, DIACRITICS,
SelectData, ArrayData, AjaxData, Tags, MinimumInputLength,
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
AttachBody,
EnglishTranslation) {
function Defaults () {
this.reset();
@ -3580,6 +3584,22 @@ define('select2/compat/matcher',[
return oldMatcher;
});
define('select2/dropdown/attachContainer',[
], function () {
function AttachContainer (decorated, $element, options) {
decorated.call(this, $element, options);
}
AttachContainer.prototype.position =
function (decorated, $container, $dropdown) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
};
return AttachContainer;
});
define('jquery.select2',[
'jquery',
'select2/core'

View File

@ -2586,8 +2586,7 @@ define('select2/dropdown',[
};
Dropdown.prototype.position = function ($dropdown, $container) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
// Should be implmented in subclasses
};
Dropdown.prototype.destroy = function () {
@ -2961,12 +2960,17 @@ define('select2/defaults',[
'./i18n/en'
], function ($, ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch,
Utils, Translation, DIACRITICS,
SelectData, ArrayData, AjaxData, Tags, MinimumInputLength,
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
AttachBody,
EnglishTranslation) {
function Defaults () {
this.reset();

View File

@ -12121,8 +12121,7 @@ define('select2/dropdown',[
};
Dropdown.prototype.position = function ($dropdown, $container) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
// Should be implmented in subclasses
};
Dropdown.prototype.destroy = function () {
@ -12496,12 +12495,17 @@ define('select2/defaults',[
'./i18n/en'
], function ($, ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch,
Utils, Translation, DIACRITICS,
SelectData, ArrayData, AjaxData, Tags, MinimumInputLength,
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
AttachBody,
EnglishTranslation) {
function Defaults () {
this.reset();
@ -13115,6 +13119,22 @@ define('select2/compat/matcher',[
return oldMatcher;
});
define('select2/dropdown/attachContainer',[
], function () {
function AttachContainer (decorated, $element, options) {
decorated.call(this, $element, options);
}
AttachContainer.prototype.position =
function (decorated, $container, $dropdown) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
};
return AttachContainer;
});
define('jquery.select2',[
'jquery',
'select2/core'

File diff suppressed because one or more lines are too long

8
dist/js/select2.js vendored
View File

@ -3014,8 +3014,7 @@ define('select2/dropdown',[
};
Dropdown.prototype.position = function ($dropdown, $container) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
// Should be implmented in subclasses
};
Dropdown.prototype.destroy = function () {
@ -3389,12 +3388,17 @@ define('select2/defaults',[
'./i18n/en'
], function ($, ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch,
Utils, Translation, DIACRITICS,
SelectData, ArrayData, AjaxData, Tags, MinimumInputLength,
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
AttachBody,
EnglishTranslation) {
function Defaults () {
this.reset();

File diff suppressed because one or more lines are too long

View File

@ -26,12 +26,17 @@ define([
'./i18n/en'
], function ($, ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch,
Utils, Translation, DIACRITICS,
SelectData, ArrayData, AjaxData, Tags, MinimumInputLength,
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
AttachBody,
EnglishTranslation) {
function Defaults () {
this.reset();

View File

@ -20,8 +20,7 @@ define([
};
Dropdown.prototype.position = function ($dropdown, $container) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
// Should be implmented in subclasses
};
Dropdown.prototype.destroy = function () {

View File

@ -0,0 +1,15 @@
define([
], function () {
function AttachContainer (decorated, $element, options) {
decorated.call(this, $element, options);
}
AttachContainer.prototype.position =
function (decorated, $container, $dropdown) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
};
return AttachContainer;
});