Skip to content

Commit

Permalink
Layout Preview: Fix text element fit to selection
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenberttpingol committed Aug 12, 2024
1 parent 7a76fa9 commit c239efd
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions modules/templates/global-elements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,11 @@ if(properties.fitToArea) {
// Set target for the text
properties.fitTarget = 'div';
var $selector = $(target).is('.global-elements-text') ?
$(target) : $(target).find('.global-elements-text');
// Scale text to container
$(target).find('.global-elements-text').xiboTextScaler(properties);
$selector.xiboTextScaler(properties);
}
]]></onTemplateRender>
</stencil>
Expand Down Expand Up @@ -497,8 +500,11 @@ $(target).find('.date').each(function(_idx, dateEl){
// Set target for the text
properties.fitTarget = '.date';
var $selector = $(target).is('.global-elements-date') ?
$(target) : $(target).find('.global-elements-date');
// Scale text to container
$(target).find('.global-elements-date').xiboTextScaler(properties);
$selector.xiboTextScaler(properties);
}
});
]]></onTemplateRender>
Expand Down Expand Up @@ -767,6 +773,9 @@ if (useCurrentDate) {
// Set target for the text
properties.fitTarget = '.date-advanced';
var $selector = $(target).is('.global-elements-date-advanced') ?
$(target) : $(target).find('.global-elements-date-advanced');
// Scale text to container
$(target).find('.global-elements-date-advanced').xiboTextScaler(properties);
Expand Down Expand Up @@ -799,8 +808,11 @@ if (useCurrentDate) {
// Set target for the text
properties.fitTarget = '.date-advanced';
var $selector = $(target).is('.global-elements-date-advanced') ?
$(target) : $(target).find('.global-elements-date-advanced');
// Scale text to container
$(target).find('.global-elements-date-advanced').xiboTextScaler(properties);
$selector.xiboTextScaler(properties);
}
}
]]></onTemplateRender>
Expand Down

0 comments on commit c239efd

Please sign in to comment.