MCPcopy Create free account
hub / github.com/codecombat/codecombat / autoSizeText

Method autoSizeText

app/views/user/CertificatesView.js:244–253  ·  view source on GitHub ↗
(selector)

Source from the content-addressed store, hash-verified

242 }
243
244 autoSizeText (selector) {
245 return this.$(selector).each((index, el) => (() => {
246 const result = []
247 while ((el.scrollWidth > el.offsetWidth) || (el.scrollHeight > el.offsetHeight)) {
248 const newFontSize = (parseFloat($(el).css('font-size').slice(0, -2)) * 0.95) + 'px'
249 result.push($(el).css('font-size', newFontSize))
250 }
251 return result
252 })())
253 }
254 }
255 CertificatesView.initClass()
256 return CertificatesView

Callers 1

afterRenderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected