|
@@ -853,6 +853,10 @@ define('select2/results',[
|
|
option.id = data._resultId;
|
|
option.id = data._resultId;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (data.title) {
|
|
|
|
+ option.title = data.title;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (data.children) {
|
|
if (data.children) {
|
|
attrs.role = 'group';
|
|
attrs.role = 'group';
|
|
attrs['aria-label'] = data.text;
|
|
attrs['aria-label'] = data.text;
|
|
@@ -1429,8 +1433,9 @@ define('select2/selection/single',[
|
|
|
|
|
|
var formatted = this.display(selection);
|
|
var formatted = this.display(selection);
|
|
|
|
|
|
- this.$selection.find('.select2-selection__rendered')
|
|
|
|
- .empty().append(formatted);
|
|
|
|
|
|
+ var $rendered = this.$selection.find('.select2-selection__rendered');
|
|
|
|
+ $rendered.empty().append(formatted);
|
|
|
|
+ $rendered.prop('title', selection.title || selection.text);
|
|
};
|
|
};
|
|
|
|
|
|
return SingleSelection;
|
|
return SingleSelection;
|
|
@@ -1523,6 +1528,8 @@ define('select2/selection/multiple',[
|
|
var $selection = this.selectionContainer();
|
|
var $selection = this.selectionContainer();
|
|
|
|
|
|
$selection.append(formatted);
|
|
$selection.append(formatted);
|
|
|
|
+ $selection.prop('title', selection.title);
|
|
|
|
+
|
|
$selection.data('data', selection);
|
|
$selection.data('data', selection);
|
|
|
|
|
|
$selections.push($selection);
|
|
$selections.push($selection);
|
|
@@ -2924,7 +2931,12 @@ define('select2/data/select',[
|
|
option.label = data.text;
|
|
option.label = data.text;
|
|
} else {
|
|
} else {
|
|
option = document.createElement('option');
|
|
option = document.createElement('option');
|
|
- option.innerText = data.text;
|
|
|
|
|
|
+
|
|
|
|
+ if (option.textContent !== undefined) {
|
|
|
|
+ option.textContent = data.text;
|
|
|
|
+ } else {
|
|
|
|
+ option.innerText = data.text;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (data.id) {
|
|
if (data.id) {
|
|
@@ -2939,6 +2951,10 @@ define('select2/data/select',[
|
|
option.selected = true;
|
|
option.selected = true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (data.title) {
|
|
|
|
+ option.title = data.title;
|
|
|
|
+ }
|
|
|
|
+
|
|
var $option = $(option);
|
|
var $option = $(option);
|
|
|
|
|
|
var normalizedData = this._normalizeItem(data);
|
|
var normalizedData = this._normalizeItem(data);
|
|
@@ -2964,12 +2980,14 @@ define('select2/data/select',[
|
|
id: $option.val(),
|
|
id: $option.val(),
|
|
text: $option.html(),
|
|
text: $option.html(),
|
|
disabled: $option.prop('disabled'),
|
|
disabled: $option.prop('disabled'),
|
|
- selected: $option.prop('selected')
|
|
|
|
|
|
+ selected: $option.prop('selected'),
|
|
|
|
+ title: $option.prop('title')
|
|
};
|
|
};
|
|
} else if ($option.is('optgroup')) {
|
|
} else if ($option.is('optgroup')) {
|
|
data = {
|
|
data = {
|
|
text: $option.prop('label'),
|
|
text: $option.prop('label'),
|
|
- children: []
|
|
|
|
|
|
+ children: [],
|
|
|
|
+ title: $option.prop('title')
|
|
};
|
|
};
|
|
|
|
|
|
var $children = $option.children('option');
|
|
var $children = $option.children('option');
|