@atlassian/aui 9.10.4 → 9.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aui/aui-prototyping-design-tokens-api-full.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-api.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.css +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes.js +1 -1
- package/dist/aui/aui-prototyping.css +1 -1
- package/dist/aui/aui-prototyping.css.map +1 -1
- package/dist/aui/aui-prototyping.js +2 -2
- package/dist/aui/aui-prototyping.js.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.css +1 -1
- package/dist/aui/aui-prototyping.nodeps.css.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.js +2 -2
- package/dist/aui/aui-prototyping.nodeps.js.map +1 -1
- package/package.json +1 -1
- package/src/js/aui/select2.js +23 -6
package/package.json
CHANGED
package/src/js/aui/select2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import $ from './jquery';
|
|
2
2
|
import '../../js-vendor/jquery/plugins/jquery.select2';
|
|
3
|
-
import layer from
|
|
3
|
+
import layer from './layer';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Wraps a vanilla Select2 with ADG _style_, as an auiSelect2 method on jQuery objects.
|
|
@@ -20,9 +20,11 @@ const auiContainer = 'aui-select2-container';
|
|
|
20
20
|
const auiDropdown = 'aui-select2-drop aui-dropdown2';
|
|
21
21
|
const auiHasAvatar = 'aui-has-avatar';
|
|
22
22
|
|
|
23
|
+
// Other constants
|
|
24
|
+
const DROPDOWN_LAYER_KEY = 'aui.select2DropdownLayer';
|
|
25
|
+
|
|
23
26
|
$.fn.auiSelect2 = function (first) {
|
|
24
27
|
let updatedArgs;
|
|
25
|
-
let dropdownLayer;
|
|
26
28
|
|
|
27
29
|
if ($.isPlainObject(first)) {
|
|
28
30
|
const auiOpts = $.extend({}, first);
|
|
@@ -83,12 +85,18 @@ $.fn.auiSelect2 = function (first) {
|
|
|
83
85
|
const $selectInput = $(this);
|
|
84
86
|
const $selectDropdown = $selectInput.select2('dropdown');
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
let dropdownLayer = $selectInput.data(DROPDOWN_LAYER_KEY);
|
|
89
|
+
|
|
90
|
+
if (!dropdownLayer) {
|
|
91
|
+
dropdownLayer = layer();
|
|
92
|
+
$selectInput.data(DROPDOWN_LAYER_KEY, dropdownLayer);
|
|
93
|
+
}
|
|
94
|
+
|
|
87
95
|
dropdownLayer.show(); // add layer to layer manager to get top z-index
|
|
88
96
|
|
|
89
97
|
$selectDropdown.css('z-index', dropdownLayer.$el.css('z-index'));
|
|
90
98
|
// mask is created during opening event, before open
|
|
91
|
-
$(
|
|
99
|
+
$('#select2-drop-mask').css('z-index', dropdownLayer.$el.css('z-index'));
|
|
92
100
|
|
|
93
101
|
if (options.multiple || $selectInput.attr('multiple')) {
|
|
94
102
|
// This is a multi-select, exiting
|
|
@@ -102,8 +110,17 @@ $.fn.auiSelect2 = function (first) {
|
|
|
102
110
|
|
|
103
111
|
select2Instance.on('select2-close', function () {
|
|
104
112
|
const $selectInput = $(this);
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
const dropdownLayer = $selectInput.data(DROPDOWN_LAYER_KEY);
|
|
114
|
+
|
|
115
|
+
if (dropdownLayer) {
|
|
116
|
+
dropdownLayer.hide();
|
|
117
|
+
} else {
|
|
118
|
+
AJS.warn(
|
|
119
|
+
'Warning! AUI: `select2-close` event handler could not discover the layer linked with the Select2 dropdown.',
|
|
120
|
+
'This may be happening when there are many instances of Select2 created on the same DOM element.',
|
|
121
|
+
'Consider checking your code as this can negatively affect performance.'
|
|
122
|
+
);
|
|
123
|
+
}
|
|
107
124
|
|
|
108
125
|
$selectInput.removeData('was-ariadescribedby-cleared');
|
|
109
126
|
});
|