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:
parent
6a0c002f94
commit
81db43fa99
@ -10,7 +10,10 @@ module.exports = function (grunt) {
|
||||
|
||||
fullIncludes = [
|
||||
'jquery',
|
||||
'select2/compat/matcher'
|
||||
|
||||
'select2/compat/matcher',
|
||||
|
||||
'select2/dropdown/attachContainer'
|
||||
].concat(includes);
|
||||
|
||||
var i18nModules = [];
|
||||
|
24
dist/js/select2.amd.full.js
vendored
24
dist/js/select2.amd.full.js
vendored
@ -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'
|
||||
|
8
dist/js/select2.amd.js
vendored
8
dist/js/select2.amd.js
vendored
@ -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();
|
||||
|
24
dist/js/select2.full.js
vendored
24
dist/js/select2.full.js
vendored
@ -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'
|
||||
|
2
dist/js/select2.full.min.js
vendored
2
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
8
dist/js/select2.js
vendored
8
dist/js/select2.js
vendored
@ -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();
|
||||
|
4
dist/js/select2.min.js
vendored
4
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
5
src/js/select2/defaults.js
vendored
5
src/js/select2/defaults.js
vendored
@ -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();
|
||||
|
3
src/js/select2/dropdown.js
vendored
3
src/js/select2/dropdown.js
vendored
@ -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 () {
|
||||
|
15
src/js/select2/dropdown/attachContainer.js
vendored
Normal file
15
src/js/select2/dropdown/attachContainer.js
vendored
Normal 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;
|
||||
});
|
Loading…
Reference in New Issue
Block a user