Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/Select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ protected function renderToggleAll()
$accesskey = substr($this->accesskey, 0, 1);
echo Html::tag('button', '', [
'accesskey' => $accesskey,
'style' => 'background: transparent;border: none !important;font-size:0;',
'class' => 's2-accesskey-btn',
'onfocus' => '$("#'.$this->options['id'].'").select2("open");',
]);
}
echo Html::tag('span', $out, ['id' => 'parent-'.$options['id'], 'style' => 'display:none']);
echo Html::tag('span', $out, ['id' => 'parent-'.$options['id'], 'class' => 's2-togall-hidden']);
}

/**
Expand Down Expand Up @@ -399,11 +399,10 @@ protected function renderInput()
{
if ($this->pluginLoading) {
$this->_loadIndicator = '<div class="kv-plugin-loading loading-'.$this->options['id'].'">&nbsp;</div>';
$opts = ['width' => '1px', 'height' => '1px', 'visibility' => 'hidden'];
Html::addCssClass($this->options, 's2-plugin-loading');
if ($this->isBs(3)) {
$opts['width'] = '100%';
Html::addCssClass($this->options, 's2-plugin-loading-bs3');
}
Html::addCssStyle($this->options, $opts);
}
Html::addCssClass($this->options, 'form-control');
$input = $this->getInput('dropDownList', true);
Expand Down
21 changes: 21 additions & 0 deletions src/assets/css/select2-addl.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,25 @@
.s2-togall-button .s2-select-label i,
.s2-togall-button .s2-unselect-label i {
margin: auto 0.25rem;
}

/* CSP-compliant classes to replace inline styles */
.s2-plugin-loading {
width: 1px !important;
height: 1px !important;
visibility: hidden !important;
}

.s2-plugin-loading-bs3 {
width: 100% !important;
}

.s2-accesskey-btn {
background: transparent !important;
border: none !important;
font-size: 0 !important;
}

.s2-togall-hidden {
display: none !important;
}
2 changes: 1 addition & 1 deletion src/assets/css/select2-addl.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.