Docs

API

autoSqueeze method

loopic.autoSqueeze([domNode])

  • domNode DOM Reference - reference to the DOM object which should be squeezed

Description

Method makes sure that the text inside an element is not crossing the borders of the element. For example, in case when you have long team name and the team name placeholder has fixed size, the text may go beyond the element. Just calling the autosqueeze method will make sure that the text fits perfectly inside - if the text is too long, it will be squeezed to the exact same size as the element containing the text.

Example

const el = loopic.getElement("homeName");
loopic.autoSqueeze(el.domNode);

// or

const el = loopic.getElement("customText");
el.domNode.innerHTML = "This is my very long text";
loopic.autoSqueeze(el.domNode);