Skip to content

Commit

Permalink
refs #37020. Optimize select2 translation binding
Browse files Browse the repository at this point in the history
  • Loading branch information
poliphilochu committed Dec 31, 2024
1 parent 9781c23 commit dd77975
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/jquery/plugins/jquery.select2.selectAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
function SelectAll() { }
SelectAll.prototype.render = function (decorated) {
var self = this,
translate = self.options.get('translations').get.bind(self.options.get('translations')),
translations = self.options.get('translations'),
translate = translations.get.bind(translations),
$rendered = decorated.call(this),
$selectAll = $(
'<button class="btn" type="button" style="margin-left:6px;">' +
Expand All @@ -57,6 +58,7 @@
'</button>'
),
$btnContainer = $('<div class="select2-selectall-actions" style="margin-top:3px; text-align:center;">').append($selectAll).append($unselectAll);

if (!this.$element.prop("multiple")) {
// This isn't a multi-select, don't add the buttons
return $rendered;
Expand Down

0 comments on commit dd77975

Please sign in to comment.