Closed rileyjshaw closed 9 years ago
Thinking about this more, adding a skipResize
flag seems like a bad idea - it complicates the polyfill for very little gain. The plugin should just handle resize
s by default.
Would love to hear your thoughts!
Yes, that would be cool but I haven't thought about how to implement it. Resizing is already de-bounced, so I don't see why not to always do it.
Fixed by https://github.com/adobe-webplatform/balance-text/pull/58. Closing.
This might be by design, but calling
$('.my-class').balanceText()
doesn't attach resize handlers to the balanced element. This is unexpected behaviour for a polyfill, since alignment generally responds to resizing.Not attaching a listener could be useful in some cases; for example, if hundreds of elements are dynamically added to the page, balanced, then replaced with other elements. This is an edge-case, and can be handled with a
skipResize
flag:$el.balanceText(true)
.Users can implement their own
debounce
function in the meantime, but it's not ideal. Happy to make a PR if this is something you're interested in!