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

Use attr instead of prop for select2-selection__rendered title (#4640)

See #3895, and jQuery docs on `attr`:

> As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.
This commit is contained in:
Tim Kang 2016-10-17 11:56:51 -07:00 committed by alexweissman
parent a395ad1d75
commit 6ff10680a6
3 changed files with 5 additions and 6 deletions

View File

@ -8,7 +8,7 @@
### Bug fixes
- Add `;` before beginning of factory wrapper (#5089)
- Clear tooltip from `select2-selection__rendered` when selection is cleared (#4746)
- Clear tooltip from `select2-selection__rendered` when selection is cleared (#4640, #4746)
- Fix keyboard not closing when closing dropdown on iOS 10 (#4680)
- User-defined types not normalized properly when passed in as data (#4632)
- Fix "the results could not be loaded" displaying during AJAX request (#4356)

View File

@ -55,7 +55,7 @@ define([
};
MultipleSelection.prototype.clear = function () {
this.$selection.find('.select2-selection__rendered').empty();
this.$selection.find('.select2-selection__rendered').empty().removeAttr('title');
};
MultipleSelection.prototype.display = function (data, container) {
@ -93,7 +93,7 @@ define([
var formatted = this.display(selection, $selection);
$selection.append(formatted);
$selection.prop('title', selection.title || selection.text);
$selection.attr('title', selection.title || selection.text);
$selection.data('data', selection);

View File

@ -66,10 +66,9 @@ define([
};
SingleSelection.prototype.clear = function () {
var $rendered = this.$selection.find('.select2-selection__rendered');
$rendered.empty();
$rendered.attr('title',''); // clear tooltip on empty
$rendered.removeAttr('title'); // clear tooltip on empty
};
SingleSelection.prototype.display = function (data, container) {
@ -95,7 +94,7 @@ define([
var formatted = this.display(selection, $rendered);
$rendered.empty().append(formatted);
$rendered.prop('title', selection.title || selection.text);
$rendered.attr('title', selection.title || selection.text);
};
return SingleSelection;