Skip to content

Commit

Permalink
Truncate texts in page composer (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 authored May 8, 2020
1 parent 014af57 commit 18d3f47
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions assets/src/js/composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@

if (self.isFormControlTypeByName(formControlName, 'name')) {
$nameFormControl = $formControl;
$title.html('<input type="text" class="page-composer__container__child__name__input" value="' + $title.text() + '">');
$title.html('<input type="text" class="page-composer__container__child__name__input" value="' + $title.text().trim() + '">');
$input = $title.find('input');
$input.bind("propertychange keyup input paste", function (e) {
$nameFormControl.val($input.val());
Expand Down Expand Up @@ -693,7 +693,7 @@
$blockTypeSelectorLoader.css('display', 'inline-block');

var blockType = $blockTypeSelectorSelect.val(),
blockTypeLabel = $blockTypeSelectorSelect.find('option:selected').text();
blockTypeLabel = $blockTypeSelectorSelect.find('option:selected').text().trim();

$.ajax({
url: blockTypeSelectorUrl,
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/public/sonata-page.back.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@

if (self.isFormControlTypeByName(formControlName, 'name')) {
$nameFormControl = $formControl;
$title.html('<input type="text" class="page-composer__container__child__name__input" value="' + $title.text() + '">');
$title.html('<input type="text" class="page-composer__container__child__name__input" value="' + $title.text().trim() + '">');
$input = $title.find('input');
$input.bind("propertychange keyup input paste", function (e) {
$nameFormControl.val($input.val());
Expand Down Expand Up @@ -701,7 +701,7 @@
$blockTypeSelectorLoader.css('display', 'inline-block');

var blockType = $blockTypeSelectorSelect.val(),
blockTypeLabel = $blockTypeSelectorSelect.find('option:selected').text();
blockTypeLabel = $blockTypeSelectorSelect.find('option:selected').text().trim();

$.ajax({
url: blockTypeSelectorUrl,
Expand Down
Loading

0 comments on commit 18d3f47

Please sign in to comment.