Skip to content

Commit

Permalink
Correctly remove the button title if the button is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 10, 2023
1 parent 1b56bad commit 9bbae92
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions core-bundle/assets/controllers/image-size-controller.js
Expand Up @@ -35,10 +35,10 @@ export default class extends Controller {
updateWizard () {
if (this.canEdit()) {
this.button.title = this.configValue.title;
this.button.disabled = false;
delete this.button.disabled;
this.buttonImage.src = this.configValue.icon;
} else {
this.button.title = null;
delete this.button.title;
this.button.disabled = true;
this.buttonImage.src = this.configValue.iconDisabled;
}
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/languages/en/default.xlf
Expand Up @@ -2109,7 +2109,7 @@
<source>visible from %s to %s</source>
</trans-unit>
<trans-unit id="MSC.editImageSize">
<source>Edit image size</source>
<source>Edit the image size</source>
</trans-unit>
<trans-unit id="MSC.booleanNot">
<source>Not %s</source>
Expand Down
3 changes: 1 addition & 2 deletions core-bundle/contao/themes/flexible/basic.css
Expand Up @@ -829,7 +829,7 @@ a.tl_submit {
vertical-align: middle;
}

.wizard .tl_text, .wizard .tl_select {
.wizard .tl_text, .wizard .tl_select, .wizard .tl_image_size {
width: calc(100% - 24px);
}

Expand All @@ -839,7 +839,6 @@ a.tl_submit {

.wizard .tl_image_size {
display: inline-block;
width: calc(100% - 24px);
}

.wizard img {
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/basic.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/main.min.css

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions core-bundle/contao/widgets/ImageSize.php
Expand Up @@ -189,27 +189,29 @@ public function generate()
{
if (isset($arrOption['value']))
{
$arrValues[] = $arrOption['value'] ?? '';
$arrOptions[] = sprintf(
'<option value="%s"%s>%s</option>',
self::specialcharsValue($arrOption['value'] ?? ''),
$this->optionSelected($arrOption['value'] ?? null, $this->varValue[2] ?? null),
$arrOption['label'] ?? null
);

$arrValues[] = $arrOption['value'] ?? '';
}
else
{
$arrOptgroups = array();

foreach ($arrOption as $arrOptgroup)
{
$arrValues[] = $arrOptgroup['value'] ?? '';
$arrOptgroups[] = sprintf(
'<option value="%s"%s>%s</option>',
self::specialcharsValue($arrOptgroup['value'] ?? ''),
$this->optionSelected($arrOptgroup['value'] ?? null, $this->varValue[2] ?? null),
$arrOptgroup['label'] ?? null
);

$arrValues[] = $arrOptgroup['value'] ?? '';
}

$arrOptions[] = sprintf('<optgroup label="&nbsp;%s">%s</optgroup>', StringUtil::specialchars($strKey), implode('', $arrOptgroups));
Expand Down Expand Up @@ -247,7 +249,7 @@ public function generate()
);
}

private function getStimulusAttributes($arrValues)
private function getStimulusAttributes($arrValues): string
{
if ($this->wizard)
{
Expand Down
2 changes: 2 additions & 0 deletions core-bundle/public/backend.ca171027.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core-bundle/public/backend.ca171027.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions core-bundle/public/backend.f14d0695.js

This file was deleted.

1 change: 0 additions & 1 deletion core-bundle/public/backend.f14d0695.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions core-bundle/public/backend.f1b41651.js

This file was deleted.

1 change: 0 additions & 1 deletion core-bundle/public/backend.f1b41651.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion core-bundle/public/entrypoints.json
Expand Up @@ -7,7 +7,7 @@
},
"backend": {
"js": [
"/bundles/contaocore/backend.f1b41651.js"
"/bundles/contaocore/backend.ca171027.js"
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/public/manifest.json
@@ -1,6 +1,6 @@
{
"ajax-form.js": "/bundles/contaocore/ajax-form.8d9f14a4.js",
"backend.js": "/bundles/contaocore/backend.f1b41651.js",
"backend.js": "/bundles/contaocore/backend.ca171027.js",
"ajax-form.8d9f14a4.js.map": "/bundles/contaocore/ajax-form.8d9f14a4.js.map",
"backend.f1b41651.js.map": "/bundles/contaocore/backend.f1b41651.js.map"
"backend.ca171027.js.map": "/bundles/contaocore/backend.ca171027.js.map"
}

0 comments on commit 9bbae92

Please sign in to comment.