Skip to content

Commit

Permalink
[framework] fixed slider on banner edit in czech language (#3656)
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin authored Dec 16, 2024
1 parent f8b7575 commit 1538b76
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
7 changes: 4 additions & 3 deletions assets/js/admin/components/NumberSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import 'jquery-ui/ui/widgets/slider';
import Register from '../../common/utils/Register';

export default class NumberSlider {

constructor ($sliderContainer) {

$sliderContainer.children('.js-number-slider__slider').slider({
min: 0,
max: 1,
Expand All @@ -13,7 +11,10 @@ export default class NumberSlider {
$(this).next('.js-number-slider__input').val(ui.value);
},
create: function (event, ui) {
$(this).slider('value', $(this).next('.js-number-slider__input').val());
$(this).slider(
'value',
$(this).next('.js-number-slider__input').val().replace(',', '.')
);
}
});
}
Expand Down
5 changes: 1 addition & 4 deletions src/Form/Admin/Slider/SliderItemFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,14 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
])
->add('opacity', NumberSliderType::class, [
'required' => true,
'scale' => 2,
'constraints' => [
new Constraints\NotBlank(['message' => 'Please enter description box opacity']),
new Constraints\Range([
'min' => 0,
'max' => 1,
'notInRangeMessage' => 'Opacity must be between {{ min }} and {{ max }}',
]),
new Constraints\Regex([
'pattern' => '/^\d(\.\d{1,2})?$/',
'message' => 'Opacity must be a number with up to two decimal places',
]),
],
'label' => t('Description opacity'),
])
Expand Down
3 changes: 0 additions & 3 deletions src/Resources/translations/validators.cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ msgstr "Odkaz musí být validní URL adresa"
msgid "Name cannot be longer than {{ limit }} characters"
msgstr "Název nesmí být delší než {{ limit }} znaků"

msgid "Opacity must be a number with up to two decimal places"
msgstr "Průhlednost musí být číslo s až dvěma desetinnými místy"

msgid "Opacity must be between {{ min }} and {{ max }}"
msgstr "Průhlednost musí být mezi {{ min }} a {{ max }}"

Expand Down
3 changes: 0 additions & 3 deletions src/Resources/translations/validators.en.po
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ msgstr ""
msgid "Name cannot be longer than {{ limit }} characters"
msgstr ""

msgid "Opacity must be a number with up to two decimal places"
msgstr ""

msgid "Opacity must be between {{ min }} and {{ max }}"
msgstr ""

Expand Down

0 comments on commit 1538b76

Please sign in to comment.